linux下查看进程运行的时间

时间:2023-03-08 19:56:05
linux下查看进程运行的时间

原文链接:http://www.centoscn.com/CentOS/2014/0403/2724.html

可通过ps 来查看,通过参数 -o 来查看

例:

 ps -eo pid,tty,user,comm,lstart,etime | grep init

参数说明:

pid:进程ID

tty:终端

user:用户

comm:进程名

lstart:开始时间

etime:运行时间

运行结果如下:

1 ?        root     init            Tue Sep  3 15:17:30 2013 12-22:50:44
说明:
pid:

tty:?

user:root

comm:init

lstart: Tue Sep   ::  【开始时间为:--  :: 周二】

etime:-:: 【运行时间:12天 22个小时50分钟44秒】