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?
You can also kill processes by name:
To answer your specific question with your set of commands, use:
Should be a comment on Levon's, but I lack the rep here to do so:
Riffing on the discussion in the accepted answer of this question: http://serverfault.com/questions/397762/how-to-make-folders-00-99-with-a-single-command-in-ubuntu
I'd say it could be preferable (or at least useful/clearer for later searchers) to run
Further reference on $() vs. ``: http://mywiki.wooledge.org/BashFAQ/082