Graham Lawrence posted on Sat, 05 Nov 2011 07:27:59 -0700 as excerpted:

> Similarly on linux; grepping my notes I find I have used

> kill $(pgrep thunar)

> and that would seem to be the extent of my need for a task manager.

FWIW, try pkill <name>. It should be a symlink to pgrep, with the 
executable checking the name used to run it to decide whether it should 
kill or just grep.

Alternatively, on Linux, there's killall <name>, which I tend to use more 
frequently as I found out about it first.  But on some Unixen (Solaris ??
), killall does something different and more drastic, so pkill is AFAIK 
more portable.

Either way, you do it in one call instead of as a compound command.

> I started top (which I was also unaware of), but it seems to be just a
> real-time version of ps.  What sort of things would one use it for, that
> you can't do through ps?

1) It's interactive and auto-updating, so it's easier to get it to sort 
and filter the way you want without remembering arbitrary commandline 
options.

2) Interactive and auto-updating means it's easy to dynamically resort, 
to look at say memory usage and then cpu usage.

3) For stuff like renicing, killing, etc, it's easier than finding the PID 
using ps and then feeding that to the appropriate command.  (Of course, 
for signalling/killing, pkill/killall works reasonably well... if you're 
trying to kill all instances of the command, not just one, at least.)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


_______________________________________________
Pan-users mailing list
Pan-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/pan-users

Reply via email to