Close all applications at a time

is there any way to close all opened applications at a time?
For example whenever i shutdown my system, i need to close each application at each time.
It is wasting of my time.
Is there any command/script is available for to do the task?
Any one have any idea about that?

Hi

You can kill all the processes owned by an user by using the single command like

#ps -aux |grep username

#pkill -u username

the above command kills everything owned by the user - including his shell and don’t run it as root

and also you can use below command to kill an processes

#kill -9 'ps -ef | grep processesname(ex:httpd) | grep -v grep | awk ‘{print $2}’`

3 Likes

see man page of “killall”
killall sends a signal to all processes running any of the speci-
fied commands. If no signal name is specified, SIGTERM is sent.
you can also use "pkill for your purpose

1 Like

I’d like do this by skill.

$ skill -KILL -p $PID
$ skill -KILL -u $USERNAME
$ skill -KILL -t $TTY
$ skill -KILL -c $CMD

1 Like