How to kill a process with a single command

command linekillprocess

I want to kill a process, after finding the id in a single step.

I currently use these two commands:

pidof <name>
kill <#number_which_is_result_of_command>

How can I write a single command to do this?

Best Answer

You can also kill processes by name:

Example:

pkill vim  # kill all processes containing vim in the process name