Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sometimes I get some problem with Skype or Netbeans. So, when I want to kill all processes of them and restart them the only way I know is to perform

$ ps aux | grep skype

get all process id

abdemo    3396  1.7  2.2 323800 89788 ?        Sl   Jun18  45:48 skype
abdemo   18871 11.8  1.8 254248 74836 ?        Sl   13:14   0:04 skype
abdemo   19009  0.0  0.0   9424   924 pts/0    S+   13:15   0:00 grep --color=auto skype

and kill all by hand.

$ sudo kill 3396 18871 19009

It work. But I think there is a better way to do this. Can you suggest me the better way?

share|improve this question

migrated from stackoverflow.com Jun 20 '12 at 12:15

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

up vote 3 down vote accepted

killall is your friend

killall skype

You only need to use sudo if the process is owned by another user e.g.

sudo killall gdm
share|improve this answer
    
killall does the job but sudo is really not needed, these are user processess. –  dav1d Jun 20 '12 at 11:25
    
Yes. The OP was using sudo, hence I did too, but it's probably not needed for these examples. I'll update my answer. –  Colin Pickard Jun 20 '12 at 11:29
add comment

'killall' is the way to go. As an alternative you can use

pidof skype

to get all the pids; don't use the ps thingie if you know the name of the process.

Combine that with a regular kill

kill `pidof skype`
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.