Kill a Process by Process Name from Ubuntu Command Line

Kill a Process by Process Name from Ubuntu Command Line

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.
Kill a Process by Process Name from Ubuntu Command Line Kill a Process by Process Name from Ubuntu Command Line Reviewed by Pakainfo on August 08, 2018 Rating: 5

No comments:

'Heartbroken' family of Nigerian man who died at Calgary airport wants answers

'Heartbroken' family of Nigerian man who died at Calgary airport wants answers Bolante Idowu Alo died following altercation wit...

Powered by Blogger.