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
说明:
pid1

tty?

user:root

comm:init

lstart: Tue Sep  3 15:17:30 2013 【开始时间为:2013-9-3  15:17:30 周二】

etime12-22:50:44 【运行时间:12天 22个小时50分钟44秒】
 
原文地址:https://www.cnblogs.com/MacoLee/p/5673634.html