How can I kill a process by name instead of PID?
pkill firefox
More information: http://linux.about.com/library/cmd/blcmdl1_pkill.htm
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.
You can kill processes by name with killall <name>
killall sends a signal to all processes running any of the specified commands. If no signal name is specified, SIGTERM is sent.
Signals can be specified either by name (e.g. -HUP or -SIGHUP ) or by number (e.g. -1) or by option -s.
If the command name is not regular expression (option -r) and contains a slash (/), processes executing that particular file will be selected for killing, independent of their name.
But if you don't see the process with ps aux
, you probably won't have the right to kill it ...