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.
You can use pgrep as follows to list the processes first:
pgrep -a java
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With