Problem
You want to catch a process, but they just shoot by too quickly.
Every time you run a ps, you cannot spot that specific command.
You need a capture script.
Solution
Run the code at the example and it will catch changing and new processes. To be more aggressive, just change “sleep 5” to “sleep 1”.
Example
user=”marcus”
ps –fu $user > catchdiff
while :
do
ps -fu $user | diff - catchdiff | egrep -v 'catchdiff|-bash$|^---|^[0-9]'
sleep 5
done