Linux Commands - ps command - display how long a process has been running (-o etime etimes)

The ps command with the -o etime or etimes option can be used to display how long a process has been running for (elapsed time).

  • etime will display elapsed time in the mm:ss format
  • etimes will display how many seconds a process has been running

In this example, the process associated with process ID number (PID) 12345 has been running for 20 seconds.

~]$ ps -p 12345 -o etime
    ELAPSED
      00:20

 

Often, you will want to know more about the process. The command option can be included to get an idea of what command the process is associated with.

~]$ ps -p 12345 -o etime,command
    ELAPSED COMMAND
      00:20 /usr/bin/foo

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





Please enter 56876 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |