Skip to content

Instantly share code, notes, and snippets.

@nejckorasa
Created August 19, 2019 16:36
Show Gist options
  • Select an option

  • Save nejckorasa/1ef88de48663d973f0cb094666289045 to your computer and use it in GitHub Desktop.

Select an option

Save nejckorasa/1ef88de48663d973f0cb094666289045 to your computer and use it in GitHub Desktop.
Kills all mac apps
#!/bin/sh
PIDS=$(ps axww -o pid,command | grep -v bash | grep Applications/ | grep -v /bin/sh | grep -v Self\Service | grep -v grep | awk '{print $1}')
for i in ${PIDS}
do
echo "Killing PID $i"
kill -9 $i
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment