How can I kill a process by name instead of PID?

后端 未结 18 2817
孤独总比滥情好
孤独总比滥情好 2020-11-28 17:10

Sometimes when I try to start Firefox it says \"a Firefox process is already running\". So I have to do this:

jeremy@jeremy-desktop:~$ ps aux | grep firefox
         


        
18条回答
  •  日久生厌
    2020-11-28 17:53

    The easiest way to do is first check you are getting right process IDs with:

    pgrep -f [part_of_a_command]
    

    If the result is as expected. Go with:

    pkill -f [part_of_a_command]
    

提交回复
热议问题