Kill process using kill command under Linux/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 lighttpd# pidof lighttpdOutput:3486
Step #2: kill process using PID (process id)
Above command tell you PID (3486) of lighttpd process. Now kill process using this PID:# kill 3486OR
# kill -9 3486Where,
- -9 is special Kill signal, which will kill the process.
killall command examples
DO NOT USE killall command on UNIX system (Linux only command). You can also use killall command. The killall command kill processes by name (no need to find PID):# killall -9 lighttpdKill Firefox process:
# killall -9 firefox-bin
No comments:
Post a Comment