Linux Scroll

Just another WordPress.com site

Linux kill command

kill – send a signal to a process

Kill by process name:

$ kill -9 `( ps -ef | grep %username | grep %process_name | grep -v grep | awk '{print $2}' )`
$ kill -9 `( ps U %username | grep %process_name | grep -v grep | awk '{print $1}' )`

Kill all sendmail processes:

# kill -9 `ps -ef | grep sendmail| awk '{print $2}'`

The process will be killed by the kernel; this signal cannot be ignored.

$ sudo kill -9 PID

The process has committed a GPF and will be killed by the kernel; this signal cannot be ignored.

$ sudo kill -11 PID

The process is requested to stop running; it should try to exit cleanly

$ sudo kill -15 PID

Kill all processes you can kill.

$ sudo kill -9 -1

List the available signal choices in a nice table.

$ sudo kill -L
Advertisements

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: