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?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
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: https://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
kill $(pidof <name>)
Further reference on $() vs. ``: http://mywiki.wooledge.org/BashFAQ/082