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?
|
I want to kill a process, after finding the id in a single step. I currently use these two commands:
How can I write a single command to do this? |
||||
|
You can also kill processes by name: Example:
|
|||||||||||||||||
|
|
To answer your specific question with your set of commands, use:
Since Tested with |
|||||||||
|
|
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 |
|||||
|
bash?tcsh? ...? – Levon Jun 23 '12 at 18:05killvariety of commands will work from the console (plus could be automated in scripts etc). Still good to make people aware of thexkilloption for sure. – Levon Jun 23 '12 at 20:38