Unix
Unix
kill command works under both Linux and UNIX/BSD like operating systems.
Step #1: First, you need to find out process PID (process id)
Use ps command or pidof command to find out process ID (PID). Syntax: ps aux | grep processname pidof processname For example if process name is lighttpd, you can use any one of the following command to obtain process ID: # ps aux | grep lighttpdOutput:
lighttpd 3486 0.0 0.1 4248 1432 ? S /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf lighttpd 3492 0.0 0.5 13752 3936 ? Ss /usr/bin/php5-cg Jul31 Jul31 0:00 0:00
OR use pidof command which is use to find the process ID of a running program: # pidof lighttpdOutput:
3486
OR
# kill -9 3486
Where,
As I said earlier killall on UNIX system does something else. It kills all process and not just specific process. Do not use killall on UNIX system (use kill -9).