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

后端 未结 18 2816
孤独总比滥情好
孤独总比滥情好 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 18:08

    Also possible to use:

    pkill -f "Process name"
    

    For me, it worked up perfectly. It was what I have been looking for. pkill doesn't work with name without the flag.

    When -f is set, the full command line is used for pattern matching.

提交回复
热议问题