On macOS how to close (kill) all terminal processes(windows)?

Using macOS sierra, i am searching for a command with which i can close/kill all opened terminal windows (processes). Also it should killing all processes opened by this terminals... Why pkill Terminal does not work?

2 Answers

Short answer:

pkill -a Terminal

Slightly longer answer:

The above command search all processes which have the name "Terminal" in them and kill them. This will kill the shell process (e.g. bash) and any processes in the same process tree (commands run under the control of the shell). It probably won't kill GUI applications since they often double fork. Since these are no longer associated with the Terminal process, it's not possible to figure out which ones were originally launched by the terminal.

Also, to find the process without killing it, run:

pgrep -a Terminal
4

How about cmd+q? It closes the application and all windows of it. If you can send keyboard command.

  • It will ask you if you want to terminate all processes before closing all terminals.
  • It does not re-open all closed terminals on next launch.
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like