---
title: terminate()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/process/terminate()
---

# terminate()

Sends a terminate signal to the receiver and all of its subtasks.

## Declaration

```swift
func terminate()
```

## Discussion

Discussion If the task terminates as a result, which is the default behavior, an didTerminateNotification gets sent to the default notification center. This method has no effect if the receiver was already launched and has already finished executing. If the receiver hasn’t been launched yet, this method raises an NSInvalidArgumentException. It’s not always possible to terminate the receiver because it might be ignoring the terminate signal. The terminate() method sends SIGTERM.

## See Also

### Related Documentation

- [launch()](foundation/process/launch().md)
- [launchedProcess(launchPath:arguments:)](foundation/process/launchedprocess(launchpath:arguments:).md)
- [terminationStatus](foundation/process/terminationstatus.md)

### Running and stopping

- [run()](foundation/process/run().md)
- [interrupt()](foundation/process/interrupt().md)
- [resume()](foundation/process/resume().md)
- [suspend()](foundation/process/suspend().md)
- [waitUntilExit()](foundation/process/waituntilexit().md)
