How long has it been running for a novice on a Linux system to see a process on my Ubuntu Server (or, depending on the process ID )? The following brother even Linux training to share to everyone good method.
··· you need to use the PS command to view information about a set of running processes. the PS Command provides the following two formatting options.
ETime shows the time that has passed since the process started, formatted as [[Dd-]hh:]mm:ss.
Etimes shows the time, in seconds, that has passed since the process started.
How do I see how long a process has been running?
You need to add the- o etimes or - o etime parameter after the PS command . Its syntax is as follows:
ps-p {pid-here}-o etime
ps-p {pid-here}-o Etimes
Step one: Find the PID of a process (OpenVPN for example )
$ pidof OpenVPN
6176
Step two: How long does the OpenVPN process run?
$ ps-p 6176-o etime
Or
$ ps-p 6176-o Etimes
Hide Output Header:
$ ps-p 6176-o etime=
$ ps-p 6176-o etimes=
this pid OPENVPN  OPENVPN  pid pid , execute command, run time, User , and user group Span style= "FONT-FAMILY:CALIBRI;" >id :
$ ps-p 6176-o Pid,cmd,etime,uid,gid
Sample output:
PID CMD ELAPSED UID GID
6176/usr/sbin/openvpn--daemon 15:25 65534 65534
this is Check the process run time under Linux method of command, have you learned? ~
Commands to view the run time of a process under Linux