Paul's Blog

It only gets better

How to see how long a process has been running on Linux

Say I have a process that I have spawned on the terminal, for instance vagrant up

If I need to see how long it has been running, I’d have to open a new terminal window then get the process ID it has, I’lltype in ps aux | grep "vagrant up" to see which ID the process has.

Sample output will be as below

To see how long process 9534 has been running, on the terminal window, I’ll type in

ps -o pid,comm,cmd,start,etime -p 9534

This will return the process ID and how long it has been currently running, the output will be as below

You can see all the info about the process above.

Kwaheri kwa sasa

Leave a comment

About

This website is my own personal scrap book. It captures thoughts, ideas, ramblings, successes and failures. Beware, for there might be dragons. :)