GNU/Linux Command – PKILL

pkill — Send signal to processes based on name and other attributes.

Summary:
kill command will send signal to the give list of process ids. pkill will send the specified signal (by default SIGTERM) to the processes based on name and other attributes. For testing, we will create 3 dummy processes using sleep command.

Examples:
$ sleep 100 & -- Dummy processes. $ pkill slee -- Kill the processes, whose name match with "slee". $ pkill -f /bin/slee -- Kill the processes, whose command linematch "/bin/slee". $ pkill -n slee -- Kill the newest process, whose name match "slee" $ pkill -o slee -- Kill the oldest process, whose name match "slee" $ pkill -x sleep -- Kill the processes, whose name exactly match"sleep". $ pkill -SIGSTOP slee -- Send SIGSTOP signal to the matchingprocesses. $ pkill -u user sleep -- Kill the processes, whose name match"sleep" and owned by user. $ pkill -u user -- Kill all processes owned by user.

Read: man pkill and man 7 signal

Advertisements
Tagged with: ,
Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: