Last active
November 7, 2020 09:53
-
-
Save syneart/9e1ab1a98898878606e8 to your computer and use it in GitHub Desktop.
with grep result, kill process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if you want to kill all process with name "inetsim" | |
ps -aux | grep inetsim | grep -v grep | awk '{print $2}' | sudo xargs kill -9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if we want to put the command to the ~/.bashrc with alias
we can put such as,
alias xargs_kill="ps -aux | grep index.php | grep -v grep | awk '{print \$2}' | xargs kill -9"