I've made a note to name the executable for my next daemon "humans".
See also the 'reboot' (or is it the 'poweroff' ?) command, which is much more direct than the Linux equivalent...
ps -ef | grep $1 | awk '{print "kill -9 " $2}' | sh
Usually stored as /usr/local/bin/kllI've found it's very useful for killing specific Java programs without having to killall -9 java.
(and, yeah, I should probably be using ps -efww instead of ps -ef, but old habits die hard... I've already got ps aliased to ps -ww for interactive use, so I should probably change this script...)
pgk ()
{
[ -z "$*" ] && echo 'Usage: pgk <pattern>' && return 1;
pgrep -fl $*;
[ "$?" == "1" ] && echo 'No processes match' && return 1;
echo 'Hit [Enter] to pkill, [Ctrl+C] to abort';
read && pkill -f $*
}What's wrong with doing that?
I've been doing that for so long I don't know why I do it
ps -C procname
ps -p pid
ps -u username
ps -t ttyname
ps -f [-w [-w]]
ps -o output-formatAnyway, it's just a reflex now to always:
ps aux | grep <program> | grep -v grep ps -ef | grep [p][r][o][g][r][a][m]This is why I love HN, I learn stuff I never knew I wanted to know!
Yes, I do sometimes have processes with camel-cased names which I may or may not remember exactly. So you:
ps auwx | grep -i {lc-version-of-camel-cased-name}
edit: `ps aux|grep`, indeed. Silly me in the early hours of a rest day :).