How to check runing time for already

Published: 14 September 2023
on channel: Tech Gurukul
39
0

To determine how long a process has been running in Linux using its Process ID (PID), you can use the ps command in combination with the -o (output format) option to display the elapsed time. Here's how you can do it:
Open your terminal and enter the following command, replacing [PID] with the actual PID of the process you want to check:

bash
ps -p [PID] -o etime=


-p [PID]: Specifies the PID of the process you want to examine.
-o etime=: Specifies the output format for the elapsed time of the process.

This command will display the elapsed time in the format DD-HH:MM:SS, indicating the number of days, hours, minutes, and seconds the process has been running.

For example, if you want to check the running time of a process with PID 12345:

bash
ps -p 12345 -o etime=

The output will look something like this:

01-23:45:12

In this example, the process has been running for 1 day, 23 hours, 45 minutes, and 12 seconds.


Watch video How to check runing time for already online without registration, duration hours minute second in high quality. This video was added by user Tech Gurukul 14 September 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 39 once and liked it 0 people.