Posted by & filed under Linux, UNIX.

Every *nix OS flavor has the kill command. It sends the TERM signal by default. But you can send other signals also.

First, find the pid (process ID) of the process:

# ps aux | grep Xvfb

Sample output:

deniz   3435  3.0  0.2 127728 20416 pts/7    Sl+  21:08   0:00 Xvfb -br -screen 0 800x600x24 :1009

Or you can use the pidof command to find the pid of any process by its name:

# pidof Xvfb

Sample output:

3435

Now you can send the TERM signal to the process:

# kill 3435

Or you can send the KILL signal:

# kill -9 3435

You can also use the killall command, which kills all processed by name, no need to finding its pid:

# killall Xvfb

Note that this kills all processed whose name includes “Xvfb”, so be careful.

Also, on UNIX (as compared to Linux) this command kills all processes. It does not accept an argument. So be careful using killall on UNIX.

On Linux you can see all available signals by,

# kill -l

Leave a Reply

  • (will not be published)