Skip to main content
Question

Force Quit All Apps- Script?


Forum|alt.badge.img+15

Looking for a script to force quit all user apps. We are seeing some issues with some apps being open when they get an update causing issues.

2 replies

Forum|alt.badge.img+15
  • Contributor
  • 589 replies
  • October 29, 2015

I use this code. It's killing only things in /Applications so modify as necessary.

#!/bin/sh

Force quit all non-essential applications

declare -a killPIDs killPIDs=$(ps axww -o pid,command | grep -v bash | grep [A]pplications/ | grep -v /bin/sh | grep -v [C]asper | grep -v [J]amf | grep -v [S]elf Service | grep -v [M]cAfee | grep -v [V]ZAccess* | grep -v grep | awk '{print $1}')

Kill said processes.

for i in ${killPIDs[@]} do echo "Killing PID $i" kill -9 $i done exit 0

Forum|alt.badge.img+21
  • Honored Contributor
  • 970 replies
  • August 4, 2021
thoule wrote:

I use this code. It's killing only things in /Applications so modify as necessary.

#!/bin/sh

Force quit all non-essential applications

declare -a killPIDs killPIDs=$(ps axww -o pid,command | grep -v bash | grep [A]pplications/ | grep -v /bin/sh | grep -v [C]asper | grep -v [J]amf | grep -v [S]elf Service | grep -v [M]cAfee | grep -v [V]ZAccess* | grep -v grep | awk '{print $1}')

Kill said processes.

for i in ${killPIDs[@]} do echo "Killing PID $i" kill -9 $i done exit 0

This script doesnt seem to work. Please can you have a look @thoule 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings