Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'See how long a given process has been running' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
See how long a given process has been running
Authored by: stevebr on Nov 28, '12 10:52:53AM

Very helpful. Thanks. Here's a little variation that will pull the whole list if there's no argument following psup, done as a bash function rather than an individual script file:

### uptime of given process or everything if none given
psup () { if [ $1 ]; 
		ps -ax -o etime,command -c | grep $1 ;
		ps -ax -o etime,command -c | less ;

I'm sure there's a far more efficient way of writing that.

[ Reply to This | # ]