everactive
asked on
killall or pkill?
Hi,
Which one should I use:
killall -u username1, username2, usernameN...
Or:
pkill -u username1, username2, usernameN...
Thanks.
Which one should I use:
killall -u username1, username2, usernameN...
Or:
pkill -u username1, username2, usernameN...
Thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
But will pkill kill all the users that are not exactly matched?
Example:
pkill -u john, mike;
johnny processes will be killed as well?
Example:
pkill -u john, mike;
johnny processes will be killed as well?
No, they won't.
Neither pkill nor killall can do that.
Neither pkill nor killall can do that.
ASKER
Sorry, can't watch videos on my mobile.
ASKER
I'll wait :)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yep,
except for the fact that you can't give killall a comma-separated list of userids with the -u flag.
wmp
except for the fact that you can't give killall a comma-separated list of userids with the -u flag.
wmp
Ah, good point. I forgot that killall -u only takes a single user.
for i in user1 user2; do killall -u $i; done