Linux Commands - ps command - display how long a process has been running (-o etime etimes)
by
Jeremy Canfield |
Updated: October 02 2020
| Linux Commands articles
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
Did you find this article helpful?
If so, consider buying me a coffee over at