Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which programs will the killall command kill?

How do I list which programs will be killed with a killall command before I run it?

I'm looking for a killall -dryrun java kind of command, which would list all java processes that would be killed by executing the killall java command.

like image 788
marengaz Avatar asked Nov 01 '25 09:11

marengaz


2 Answers

You can use pgrep as follows to list the processes first:

pgrep -a java
like image 103
Robby Cornelissen Avatar answered Nov 04 '25 08:11

Robby Cornelissen


Depending on the killall version used on your system killall -s might do the trick. E.g. this is the case at least on Mac OS X and FreeBSD

On other variants of killall -s SIGNAL is used to specify the signal to send. Killall is not part of UNIX/POSIX standard so implementations vary.

like image 44
Timo Avatar answered Nov 04 '25 09:11

Timo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!