[HOW TO] get up time process linux?

Once day you want to get the up time of application/ process. But you cannot really tell how long the process has been alive. To get this you may use a couple of commands like the following:

cattek@cattek:~$ ps -ax | grep nylas
 7290 ?        Sl     0:22 /usr/share/nylas/nylas
 7294 ?        S      0:00 /usr/share/nylas/nylas --type=zygote --no-sandbox
 7320 ?        Sl     0:00 /usr/share/nylas/nylas --type=gpu-process --channel=7290.0.1818467183 --mojo-application-channel-token=EA75EFF296429385F4F336F81485903C --no-sandbox --window-depth=24 --x11-visual-id=32 --supports-dual-gpus=false --gpu-driver-bug-workarounds=5,18,48,56 --disable-gl-extensions=GL_ARB_occlusion_query GL_ARB_occlusion_query2 --gpu-vendor-id=0x8086 --gpu-device-id=0x191e --gpu-driver-vendor --gpu-driver-version --gpu-driver-date --v8-natives-passed-by-fd --v8-snapshot-passed-by-fd

The first column contains the PID, In this case, 7320 is the PID of the master process

cattek@cattek:~$ ps -p 7320 -o etime=
   01:26:58

Nice, good luck for you. Finally you can now write a script.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

0 nhận xét:

Post a Comment