How can I kill a process using the bash command prompt? Do I always need to kill the process using PID?
To kill processes by name use the killall command. The syntax is as follows:
killall -SIGNAME process-name
The default signal for kill is TERM (terminate process). To list available signals, enter:
$ kill -l
The following are useful signals and used frequently by sys admins and Ubuntu users:
- SIGHUP (1) - Hangup detected on controlling terminal or death of controlling process.
- SIGINT (2) - Interrupt from keyboard.
- SIGKILL (9) - Kill signal i.e. kill running process.
- SIGSTOP (19) - Stop process.
- SIGCONT (18) - Continue process if stopped.
Examples - Ubuntu Linux: Killing Process
To kill all apache2 process, enter:
$ sudo killall -9 apache2
To kill all firefox process, enter:
$ sudo killall -9 firefox-bin
You can also use the pkill command as follows to kill all php-cgi process, enter:
$ pkill -KILL php-cgi
The -u option will kill only processes whose effective user ID is set to vivek:
$ sudo pkill -KILL -u vivek php-cgi
See also:
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 4 comments… read them below or add one }
If you have a process name you can kill them via:
# killall PROCESSNAME
even better is the program pkill
# pkill PROCESSNAME
This kill all processes named PROCESSNAME.
kill -SIGKILL `pidof process-name`
The last one worked for me
Thank you Vladimir
Thanks a million. acroread was killing my machine and the killall -9 acroread did the trick. I can now work.