How to check runing time for already

Опубликовано: 14 Сентябрь 2023
на канале: 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.


Смотрите видео How to check runing time for already онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Tech Gurukul 14 Сентябрь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 39 раз и оно понравилось 0 людям.