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 Linux view the start and run time of a process

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Today I'll show you how Linux looks at the start and run time of a process. The content of the article is good. Now I would like to share it with you. Friends who feel in need can understand it. I hope it will be helpful to you. Let's read it along with the editor's ideas.

Sometimes it is necessary to know when a process is running or whether it has been completed to facilitate the management of the system.

Linux's method of viewing the start and run time of a process

1 ps-o command $ps-eo pid,tty,user,comm,lstart,etime | grep fastq parameter description: pid: process ID tty: terminal user: user comm: process name lstart: start time etime: run time

The running results are as follows:

91413 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91414 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91415 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91416 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91417 pts/0 root Fastq-dump Tue May 21 10:01:44 2019 45:05 91418 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91419 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91420 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91421 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91422 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91423 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91424 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91425 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91426 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91427 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91428 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91429 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45:05 91430 pts/0 Root fastq-dump Tue May 21 10:01:44 2019 45:05 91431 pts/0 root fastq-dump Tue May 21 10:01:44 2019 45 ps-ef and ps aux commands ps-ef: standard format display process ps-aux:BSD format display process

(base) pc@pc-System-Product-Name:/project/raw_fq$ ps-ef | head UID PID PPID C STIME TTY TIME CMD root 1, May 09? 00:00:08 / sbin/init splash root 2, May 09? 00:00:00 [kthreadd] root 3 20 May 09? 00:00:00 [rcu_gp] root 4 20 May 09? 00:00:00 [rcu_par_gp] root 6 20 May 09 00:00:00 [kworker/0:0H-kb] root 8 20 May 09? 00:00:00 [mm_percpu_wq] root 9 20 May 09? 00:00:03 [ksoftirqd/0] root 10 20 May 09-00:01:04 [rcu_sched] root 11 20 May 09-00:00:00 [rcu_bh] (base) pc@pc-System-Product-Name:/project/raw_fq$ ps aux | head USER PID% CPU% MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 225888 6456? Ss May 09 0:08 / sbin/init splash root 2 0.000? S May 09 0:00 [kthreadd] root 3 0.0 0.0 00?

IUSER: user name% CPU:% CPU occupied by the process% MEM:% memory occupied VSZ: amount of virtual memory used by the process (KB)

RSS: the fixed amount of memory consumed by the process (KB) (number of pages residing)

STAT: status of the process START: the time when the process was triggered to start

TIME: the time that the process actually runs using CPU

Top command: top can also look at process information. Different from ps, ps looks at the process information at the moment when the command is executed. Top is continuously monitored, ctrl c exits ps just to view processes, while top can also monitor system performance, such as average load, cpu and memory consumption. Generally speaking, ps mainly looks at processes, especially the process top you care about mainly depends on cpu, memory usage, and sorting of the processes with the most resources from high to low. The focus is on resource usage.

This is all about how Linux views the startup and run time of a process. For more information about how to view the startup and run time of a process by Linux, you can search for previous articles or browse the following articles to learn! I believe the editor will add more knowledge to you. I hope you can support it!

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

Development

Wechat

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

12
Report