ps
ps process viewing command, providing viewing, running status of the process, occupied resources and other information
ps only view the instantaneous status of the current process, not dynamic and continuous; (real-time monitoring commandtop
)
parameter
-A
: All processes are displayed, which has the same effect as -e;
-a
: All processes under the current terminal, including processes of other users;
-u
: User-based process status;
x
: Usually used with the a parameter, More complete information can be listed.
l
: Longer and more detailed information about the PID is listed;
j
: Jobs format
-f
: Do a more complete output.
F
Represents the flag of this program (flag), 4 represents the user is superuser (super user);
S
represents the state of this program (STAT);
UID
represents the identity of the executor
PID
Process ID number! The PPID at the bottom is the ID of the parent process;
USER
: Which user account does this process belong to?
C
Percentage
%CPU
of CPU resources used: The percentage of CPU resources used by
%MEM
the process; : The percentage of physical memory occupied by the
VSZ
process; : The amount of virtual memory used by the process (Kbytes)
RSS
: The fixed amount of memory (Kbytes)
TIME
used by the process lost CPU time.
SZ
The amount of memory used;
PRI
Refers to the execution priority of the process (abbreviation for Priority), the smaller the value, the earlier it will be executed;
NI
the nice value of this process, which represents the revised value of the priority of the process that can be executed.
ADDR
This is a kernel function that indicates which part of memory the program is in. If it is an executing program, it is generally "-"
WCHAN
whether the program is currently running, if it is - it means it is running;
TTY
: The process is running on the terminal. If it has nothing to do with the terminal, it will display ?. In addition, tty1-tty6 are the login programs on the local machine. If it is pts/0, etc., it means that it is connected by the network. into the host program.
STAT
: The current state of the program, the main states are:
1. `R` :该程序目前正在运作,或者是可被运作;
2. `S` :该程序目前正在睡眠当中 (可说是 idle 状态啦!),但可被某些讯号(signal) 唤醒。
`T` :该程序目前正在侦测或者是停止了;
`Z` :该程序应该已经终止,但是其父程序却无法正常的终止他,造成 zombie (疆尸) 程序的状态
START
: The time when the process is triggered to start;
TIME
: The time when the process actually uses the CPU.
CMD
Name of command given
COMMAND
: What is the actual command of the program?
common way
ps -l
Display the PID and related information of this login Display the PID and related information
ps -lA
of all programs
ps aux
List all currently running programs in memory
ps -axjf
List the program tree form
[reference document]