we can use killall to terminate processes that have a specific file open at that time by just mentioning the file name. Some of the most useful options for killall are listed here:
-i : This option puts killall in interactive mode. You’ll have to confirm before any process is killed.
-r : This option allows you to work with regular expressions. This is useful because you won’t have to enter the exact process name.
-u : This option kills only processes that a specific user owns. Useful if you need to terminate everything a user is doing right now.
EX:-
if you need to terminate all http processes, use regular expressions as in the following command:
killall -r http
For example, if you want to kill all processes that a user has currently opened, use the following command:
killall -u username
it is mainly used to kill a process and all its children
ex:- killall pid
No comments:
Post a Comment