There are a number of ways to kill a process if you know the name of the process. Here’s a couple different ways you can accomplish this. We are going to assume that the process we are trying to kill is named irssi
kill $(pgrep irssi)
killall -v irssi
pkill irssi
kill `ps -ef | grep irssi | grep -v grep | awk ‘{print $2}’`
These techniques can be useful in shell scripts, where you wouldn’t know the process ID and would need to restart or kill a process.
- › How to Find the PID of a Linux Process With pidof or pgrep
- › How to Manage Processes from the Linux Terminal: 10 Commands You Need to Know
- › Force Quit an Unresponsive Graphical Application in Ubuntu
- › 5 Ways to See If Your Phone Is Being Tapped
- › Update iTunes on Windows Now to Fix a Security Flaw
- › 6 Ways Our Tech Is Better Than Star Trek’s
- › What You Should (and Shouldn’t) Unplug or Turn Off When You Go On Vacation
- › 10 Kodi Features You Should Be Using