Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does the Linux server system check the start time of the process

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to view the process startup time of Linux server system". In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!

Linux system server to view the process startup time and runtime commands

ps -o lstart -p PID #Query according to PID

ps -o lstart, time-p PID #Query according to PID, print out startup time and running time

ps -eO lstart |grep PROCESS #Query by process name

Tip:

1, capital O for preloaded, lowercase o for user-defined,e for all processes

2. If the detected time is 1-16:15:58, it means that the journey has run for 1 day, 16 hours and 15 minutes.

3, time represents elapsed time, i.e. the time the program has been running

A few examples

$ ps -o lstart,etime -p 13062 #Print start time and duration from PID

STARTED ELAPSED

Thu Sep 21 09:41:40 2018 1-01:50:35

$ ps -eo pid,lstart,cmd #Print PID, start time of all processes (-e)

3428 Mon Nov 6 20:55:20 2018 /sbin/udevd -d

3495 Mon Nov 6 20:55:22 2018 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5

3508 Mon Nov 6 20:55:22 2018 /usr/sbin/nscd

3532 Mon Nov 6 20:55:29 2018 /usr/sbin/snmpd -LS 2 d -Lf /dev/null -p /var/run/snmpd.pid -a

3548 Mon Nov 6 20:55:29 2018 /usr/sbin/sshd

3557 Mon Nov 6 20:55:29 2018 ntpd -u ntp:ntp -p /var/run/ntpd.pid -g

3568 Mon Nov 6 20:55:29 2018 crond

#Print out the pid,uid,user, startup time, duration, CPU time (cputime), and cmd of a process

$ ps -eo pid,euid,euser,lstart,etime,cputime,cmd | grep searcher_server

7259 7259 Fri Sep 22 11:36:21 2018 00:01 S pts/0 00:00:00 grep 13062

13062 13062 Thu Sep 21 09:41:40 2018 1-01:54:42 S ? 1-15:50:04 /export/App/jd_search/searcher/server/bin/searcher_server

"Linux server system how to view the process start time" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report