How do I find the uptime of a given linux process.

ps aux | grep gedit | grep -v grep

gives me a whole lot of information which includes the time at which the process was started. I am specifically looking for switch which returns the uptime of a process in milliseconds.

Thanks

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted
ps -o "cputime=" $pid

See "Standard format specifiers" in the ps manual page.

(The = character in -o causes the header to be disabled.)

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.