Linux monitor process ps command details

  • 2020-05-17 07:28:55
  • OfStack

This paper refers to UNIX/Linux system management technical manual.

Operating system: Debian 8.5

Only the following three commonly used combination of command explanation, more complete command please own ps --help all Look at it.

1. ps -ef

Output display:


UID  PID PPID C STIME TTY   TIME CMD
root   1  0 0 2016 ?  00:00:28 /lib/systemd/systemd --system --deserialize 15
root   2  0 0 2016 ?  00:00:00 [kthreadd]
root   3  2 0 2016 ?  00:00:25 [ksoftirqd/0]
root   5  2 0 2016 ?  00:00:00 [kworker/0:0H]
root   7  2 0 2016 ?  00:04:57 [rcu_sched]
root   8  2 0 2016 ?  00:00:00 [rcu_bh]
......

Output field description:

UID: the user to which the process belongs. PID: ID of the process. PPID: PID for the parent process. C: usage/scheduling information for CPU. STIME: time to start the process. TTY: control terminal. TIME: consumes CPU time. CMD: command line for process execution.

2. ps aux

Output display:


USER  PID %CPU %MEM VSZ RSS TTY  STAT START TIME COMMAND
root   1 0.0 0.0 176040 3272 ?  Ss 2016 0:28 /lib/systemd/systemd --system --deserialize 15
root   2 0.0 0.0  0  0 ?  S  2016 0:00 [kthreadd]
root   3 0.0 0.0  0  0 ?  S  2016 0:25 [ksoftirqd/0]
root   5 0.0 0.0  0  0 ?  S< 2016 0:00 [kworker/0:0H]
root   7 0.0 0.0  0  0 ?  S  2016 4:57 [rcu_sched]
root   8 0.0 0.0  0  0 ?  S  2016 0:00 [rcu_bh]
......

Output field description:

USER: the user to whom the process belongs. PID: ID of a process. %CPU: the percentage of CPU that the process is using. %MEM: the percentage of memory that the process is using. VSZ: virtual size of the process. RSS: number of pages in memory. TTY: control terminal. STAT: current process status. The & # 8203; R= runnable; D= uninterruptible sleep state (such as waiting for disk); S= hibernation state (Sleep); T= being tracked or stopped (Stop); Z= zombie process (Zombie);

The & # 8203; Additional marks:

The & # 8203; W= process is swapped out (Progress is swapping out); < = process priority is higher than normal priority; N= process priority lower than normal; L= some pages are locked in memory; s= process is the precursor of the session (Process is a session leader) START: process start time. TIME: the CPU time that the process has consumed. COMMAND: command line for process execution.

3. ps lax

ps lax runs faster than ps aux because it does not have to convert each UID to a user name.

Output display:


F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY  TIME COMMAND
4  0  1  0 20 0 176040 3272 -  Ss ?   0:28 /lib/systemd/systemd --system --deserialize 15
1  0  2  0 20 0  0  0 -  S ?   0:00 [kthreadd]
1  0  3  2 20 0  0  0 -  S ?   0:25 [ksoftirqd/0]
1  0  5  2 0 -20  0  0 -  S< ?   0:00 [kworker/0:0H]
1  0  7  2 20 0  0  0 -  S ?   4:58 [rcu_sched]
1  0  8  2 20 0  0  0 -  S ?   0:00 [rcu_bh]

Output field description:

F: process flag. UID: ID for the user to whom the process belongs. PID: process ID. PPID: parent process ID. PRI: the priority of the process. The smaller the value, the higher the priority. NI: the courtesy of a process can also be understood as the priority of the process. The smaller the value, the higher the priority. VSZ: virtual size of the process. RSS: number of pages in memory. WCHAN: the address of the object that the process is waiting for. STAT: current process state. The & # 8203; R= runnable; D= uninterruptible sleep state (such as waiting for disk); S= sleep state (Sleep); T= tracked or stopped (Stop); Z= zombie process (Zombie);

The & # 8203; Additional marks:

The & # 8203; W= processes are swapped out (Progress is swapping out); < = process priority is higher than normal priority; N= process priority lower than normal; L= some pages are locked in memory; s= process is the precursor of the session (Process is a session leader) TTY: control terminal. TIME: CPU time that has been consumed by the process. COMMAND: command line for process execution.

conclusion

The above is the whole content of ps command in Linux. I hope the content of this article can bring you some help in your study or work. If you have any questions, you can leave a message to communicate.


Related articles: