I use ps ef
and ps rf
a lot.
Here is a sample output for ps rf
:
PID TTY STAT TIME COMMAND
3476 pts/0
/usr/bin/pgrep -o <process_name>
where '-o' is the oldest (least recently started) of the matching processes
how about ps fuxa | grep 'PID\|[0-9] /'
for all parents, or:
ps fuxa | grep '[0-9] /' | grep 'PID\|<commandname>'
for single process?
From key words KEYWORD
ps aux | grep -i KEYWORD | grep -v grep | awk '{print $2}'|sort -h|head -1|xargs kill
BTW, is this assumption that parent process ID is the smallest ID valid????