9

Identify PID of long running process

view full story
linux-howto

http://stackoverflow.com – I need to identify long running process and save pid of that process to a file. With the below command I am able to identify age of long running process. But after this I am struck with how to grep PID of that long running process? Any help is greatly appreciated. ps -eo pid,etime,cmd | grep DSD.RUN | awk '{print $2}' | ./script.sh | \ xargs -I [] bash -c 'if [ "[]" -gt "86400" ]; then echo []; fi' Script.sh: (got this from stackoverflow post) #!/bin/bash awk -F $':' -f <(cat - <<-'EOF' { if (NF == 2) { print $1*60 + $2 } else if (NF == 3) { split($1, a, "- (HowTos)