Skip to content

Instantly share code, notes, and snippets.

@jay-lannister
Created November 7, 2014 12:41
Show Gist options
  • Save jay-lannister/336e3e32e0977ff1dcf1 to your computer and use it in GitHub Desktop.
Save jay-lannister/336e3e32e0977ff1dcf1 to your computer and use it in GitHub Desktop.
프로세스 이름을 이용해 프로세스 죽이기
# http://www.howtogeek.com/howto/ubuntu/kill-a-process-by-process-name-from-ubuntu-command-line/
# http://stackoverflow.com/questions/8594653/killing-all-process-from-command-line
#
# Side note -
#
# kill -9 is overkill (no pun intended) because it prevents the killed process from running cleanup (e.g., atexit() calls, like the difference between exit and _exit). It may or may not be a problem with firefox, but in general consider trying "kill -9" only after plain "kill" fails.
# kill
## case-sesitive
kill -KILL $(pgrep TextMate)
## case-insesitive
kill -KILL $(pgrep textmate)
## another versions
kill -KILL $(ps -x | grep 'firefox' | awk '{print $1}')
ps -ef | grep '[f]irefox' | awk '{print $1}' | xargs kill -9 ;
ps -ef | awk '/[f]irefox/ {print $1}' | xargs kill -9 ;
# killall
## case-sesitive
killall -v irssi
# pkill
## case-sesitive
pkill TextMate
## case-insesitive
pkill textmate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment