Linux

Linux查看进程时间,查看进行开始时间,进程执行了多久时间

2020-05-27  本文已影响0人  青山淼淼
  1. 先找一个想要查看的进程。比如我这里想看我nginx执行的时间,先查看有哪些进程。
ps -ef | grep nginx

输出:

root      8186  5143  0 21:12 pts/0    00:00:00 grep --color=auto nginx
root     10971  9407  0 4月28 ?       00:00:00 nginx: master process ./nginx/sbin/nginx
65534    12381 10971  0 4月29 ?       00:04:55 nginx: worker process
  1. 看下进程10971 的开始时间
ps -p 10971 -o lstart

#输出
                 STARTED
Tue Apr 28 20:24:36 2020
  1. 看下进程10971 的执行时间
ps -p 10971 -o etime

#输出

    ELAPSED
29-01:27:33

4.查看进程10971 开始时间,结束时间

ps -p 10971 -o lstart,etime

#输出

STARTED     ELAPSED
Tue Apr 28 20:24:36 2020 29-01:29:26

上一篇 下一篇

猜你喜欢

热点阅读