user3874530
user3874530

Reputation: 53

Kill all sleep processes

How do I kill all sleep processes that are running? I realize that I can either use the kill command to kill each process via its PID, or I can use pkill to kill the sleep command by name. I'm trying to figure out how I would do this, any help would be appreciated. I used

man pkill

to get some help but am still unsure.

Upvotes: 2

Views: 23662

Answers (2)

W. Schweinsberg
W. Schweinsberg

Reputation: 9

There is an option for the pkill command that will kill all processes named the given pattern.

pkill -x [pattern] (or) pkill -exact [pattern]

These commands will kill all processes with the same name as [pattern]

Upvotes: 0

Jonathon Reinhart
Jonathon Reinhart

Reputation: 137398

If you really must do this dangerous action, use the killall command:

killall sleep

Upvotes: 3

Related Questions