Skip to content

Instantly share code, notes, and snippets.

@akingdom
Last active March 11, 2024 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akingdom/d85129b08a96ffba8c89741abf6d1974 to your computer and use it in GitHub Desktop.
Save akingdom/d85129b08a96ffba8c89741abf6d1974 to your computer and use it in GitHub Desktop.
Killing processes on MacOS

In MacOS here are two ways to kill processes in one hit. I'll use Google Drive as an example.

List process IDs (optional, useful to query beforehand or verify afterwards):

ps aux | grep "Google Drive" | awk '{print $2}'

Kill:

ps aux | grep "Google Drive" | awk '{print $2}' | xargs kill -9

-or-

sudo killall -9 "Google Drive"

The above two perform the same task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment