The ps command in Linux is an abbreviation of Process Status. The ps command is used to list those processes running in the system.
Note: ps is to display the status of the instantaneous process, not dynamic and continuous. If you want to monitor the process in real time, you should use the top command.
1. Parameter introduction
-
-e, -A: all processes are displayed
-
-f: display the output in full format
-
-a: display all processes under the current terminal, including processes of other users
-
-u: user-based process status
-
-x: usually used with the a parameter to list more complete information
-
-aux to filter processes according to CPU or memory usage, for example
ps -aux --sort -pcpu
orps -aux --sort -pmem
-
-l: display a long list
-
-L: Display the threads in the process, for example
ps -L 123
, 123 is the process ID -
-j: display task information
-
-H: Display progress in a hierarchy, tree structure
-
-o: allows the user to specify which columns will be displayed when the ps command is run
2. The result column information table of the ps command indicates:
-
UID: the user who started the process
-
PID: ID of the starting process
-
PPID: the parent process ID of the startup process
-
C,% CPU: the percentage of CPU resources used by the process
-
S, STAT: the status of the process
-
TTY: which terminal is running on
-
TIME: CPU time used by the process
-
CMD: Process command
-
PRI: the priority of the process
-
ADDR: memory address of the process
-
START: The time when the process was triggered to start
-
COMMAND: the actual command of the program
-
% MEM: the percentage of physical memory occupied by the process
-
VSZ: The amount of virtual memory used by the process (Kbytes)
-
RSS: The fixed amount of memory occupied by the process (Kbytes)
-
SZ: used memory size