码迷,mamicode.com
首页 > 系统相关 > 详细

linux下查看一个进程的启动时间和运行时间

时间:2017-08-03 20:07:07      阅读:310      评论:0      收藏:0      [点我收藏+]

标签:shell

使·用 ps命令 :#ps -A -opid,stime,etime,args

ps -A -opid,stime,etime,args

结果:

root:src# ps -A -opid,stime,etime,args
  PID STIME     ELAPSED COMMAND
    1 09:21    08:56:14 init [3]                                   
    2 09:21    08:56:14 [migration/0]
    3 09:21    08:56:14 [ksoftirqd/0]
    4 09:21    08:56:14 [watchdog/0]
    5 09:21    08:56:14 [events/0]
    6 09:21    08:56:14 [khelper]
    7 09:21    08:56:14 [kthread]
   10 09:21    08:56:14 [kblockd/0]
   11 09:21    08:56:14 [kacpid]
   47 09:21    08:56:14 [cqueue/0]

也可以通过如下命令排序:

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

参数说明:

pid:进程ID

tty:终端

user:用户

comm:进程名

lstart:开始时间

etime:运行时间


linux下查看一个进程的启动时间和运行时间

标签:shell

原文地址:http://31329846.blog.51cto.com/3074923/1953288

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!