Linux: How to kill specific process with it's name?
If you want to find a process named "testapp" and kill it, how can you do this?
ps -ef | grep testapp | head -n 1 | fmt -u | cut -d ' ' -f 2 | xargs kill -9
But, this is too complex solution for simple issue. I just can use 'killall'. Such as 'killall testapp'.
It's still interesting to learn Linux tools to manipulate text data. (such as head, cut, fmt ...)
References:
ps -ef | grep testapp | head -n 1 | fmt -u | cut -d ' ' -f 2 | xargs kill -9
But, this is too complex solution for simple issue. I just can use 'killall'. Such as 'killall testapp'.
It's still interesting to learn Linux tools to manipulate text data. (such as head, cut, fmt ...)
References:
댓글
댓글 쓰기