Wednesday, 1 February 2017

[Shellscript] Kill all processes filtered using grep

1
2
3
4
5
6
7
8
#!/bin/sh

# Kill Process
echo "Kill process..."
ps -ef | grep ... | grep ... | awk '{print $2}' | while read line; do kill $line; done
echo "Finished to kill process."

exit 0

No comments:

Post a Comment