The ps:process status is used to list those processes that the system is currently running, that is, a snapshot of the current process.
$ps | Head PID TTY time CMD 3326 pts/5 00:00:00 bash 3796 pts/5 00:00:00 PS 3797 pts/5 00:00:00 Head
Syntax: ps [-aacdefhjlmnvwy] Span style= "font-size:14px;font-family: ' The song Body '; Color:rgb (73,68,41);" >[ACEFGHLNRSSTUVXX] [-c < Directive name >][-g < Group name >][-G < Group identification code >][-p < Program Identification code >][p < program identification Code >][-s < stage Job >][-t < terminal number >][t < terminal number >][-u < user identification Code >][-U < user identification code >][U < user name >][-< program identification code >][--cols < number of characters per column >][-- columns < number of characters per column >][--cumulative][--deselect][--forest][--headers][--help][--info][--lines < Show Columns >][--no-headers][--group < Group name >][-Group < Group Identification Code >][--pid < program ID >][--rows < Show Columns >][--sid < stage jobs >][--tty < terminal numbers >][--user < user names >][--User < user identification Code >][--version][--width < number of characters per column;]
Parameter description:
-A shows all the programs executed under all terminals, except for the stage job leader.
a displays all programs under the current terminal, including those of other users.
-a displays all programs.
-C Displays the CLS and PRI fields.
C when the program is listed, the actual instruction name of each program is displayed, without the indication of the path, parameter, or resident service.
-c< directive name > Specifies the name of the execution instruction and lists the status of the program for that instruction.
-D displays all programs, but does not include the stage job leader program.
-E The effect of this parameter is the same as specifying the "A" parameter.
e Displays the environment variables that are used by each program when you list the program.
-F Displays Uid,ppip,c and Stime fields.
F Displays the tree structure with ASCII characters and expresses the relationship between the programs.
-g< Group name > The effect of this parameter is the same as specifying the "-G" parameter, which can also be specified using the name of the stage job leader.
G shows all the programs under the current terminal, including the group leader's program.
-g< Group ID > list the status of the program that belongs to the group, or you can use the group name to specify it.
H does not display the title column.
-h displays a tree structure that represents the inter-program relationship.
-j or J Displays the status of the program in a work-controlled format.
-L or L use a detailed format to show the status of the program.
Information about the position of the column.
-M or m displays all threads.
n represents the user and Wchan fields as numbers.
-n Displays all programs except the program under the PS Command Terminal.
-p< Program Identification code > Specify program identification code, and list the status of the program.
p< Program ID > The effect of this parameter is the same as specifying the "-P" parameter, only slightly different in the list format.
R only lists the programs that are currently in progress on the current terminal.
-s< Phase Job > Specify the program identification code for the stage job, and lists the status of the program that belongs to the stage job.
s uses program signal format to display program status.
S lists programs, including interrupted sub-program data.
-t< Terminal number > Specify the terminal number, and list the status of the program belonging to the terminal.
t< Terminal number > The effect of this parameter is the same as specifying the "-T" parameter, with only a slight difference in the format of the list.
-T displays all programs under the current terminal.
-u< User ID > The effect of this parameter is the same as specifying the "-u" parameter.
U Displays the status of the program in a user-oriented format.
-u< User ID > list the status of the program that belongs to the user, or you can specify it by using the user name.
u< User name > Lists the status of programs that belong to that user.
V Displays the program status in virtual memory format.
-V or V displays version information.
-W or W uses a wide format to display program status.
x shows all programs and does not differentiate them by terminal.
X Displays the status of the program using the legacy Linux I386 login format.
When the-y mate parameter "-l" is used, the F (flag) field is not displayed and the addr field is replaced with the RSS field.
-< Program Identification code > The effect of this parameter is the same as specifying the "P" parameter.
--cols< number of characters per column > sets the maximum number of characters per column.
--columns< the number of characters per column > The effect of this parameter is the same as specifying the "--cols" parameter.
--cumulative the effect of this parameter is the same as specifying the "S" parameter.
--deselect the effect of this parameter is the same as specifying the "-n" parameter.
--forest the effect of this parameter is the same as specifying the "F" parameter.
--headers the title column repeatedly.
--help online Help.
--info Displays the error message.
--lines< Display column Count > set the number of columns for the display screen.
--no-headers the effect of this parameter is the same as specifying the "h" parameter, with only a slight difference in the format of the list.
--group< Group name > This parameter has the same effect as specifying the "-G" parameter.
--group< Group ID > The effect of this parameter is the same as specifying the "-G" parameter.
--pid< Program Identification code > The effect of this parameter is the same as specifying the "-P" parameter.
--rows< Displays the number of columns > The effect of this parameter is the same as specifying the "--lines" parameter.
--sid< Stage Job > The effect of this parameter is the same as specifying the "-S" parameter.
--tty< Terminal number > The effect of this parameter is the same as specifying the "-T" parameter.
--user< User name > This parameter has the same effect as specifying the "-u" parameter.
--user< User ID > The effect of this parameter is the same as specifying the "-u" parameter.
--version the effect of this parameter is the same as specifying the "-V" parameter.
--widty< the number of characters per column > The effect of this parameter is the same as specifying the "-cols" parameter.
$ps-U Root---Display information for a specified user
$PS-A---Show all process information
$PS-EF---Show all process information, along with the command line
$PS-L---The current self-logged PID and related information are listed in the F S UID pid PPID C PRI NI ADDR SZ wchan TTY time CMD0 S 1000 3326 3318 0 0-2154 wait pts/5 00:00:00 bash0 R + 3878 3326 0 0-1603-PTS/5 00:00:00 PS
Description
F represents the flag of this program, 4 represents the user as Super user
S represents the status of this program (STAT)
R: The program is currently in operation or can be operated
S: The program is currently sleeping (can be said to be idle) but can be awakened by certain signals (signal).
T: The program is currently detecting or stopping
Z: The program should have been terminated, but the parent program could not properly terminate him, causing the state of the zombie (Xinjiang Corpse) program
The UID program is owned by the UID.
The PID is the ID of the program, which is the number of the process
PPID is the ID of its parent program
Percentage of resources used by the C CPU
PRI this is the abbreviation for priority (precedence order), which is described in detail later
NI This is a nice value, and in the next section we will continue to introduce
ADDR This is the kernel function, which points out the part of the program that is in memory. If it's a running program, it's usually "-"
SZ-Used memory size
Wchan whether the program is currently in operation, if it is-indicates that it is operating
TTY The process is operating on that terminal, if it is not related to the terminal, then display?, in addition, TTY1-TTY6 is the computer above the login program, if it is pts/0 and so on, it is represented by the network connected to the host computer program.
time when the process is triggered to start
What are the commands that CMD has issued?
in the case of presets, PS only lists the PID associated with the current bash shell, so when I use Ps-l, only three PID .
$ps auxuser pid %cpu %mem vsz RSS TTY STAT START TIME commandroot 1 0.0 0.0 4588 2568 ? ss 08:43 0:01 /sbin/initroot 2 0.0 0.0 0 0 ? s 08:43 0:00 [kthreadd]root 3 0.0 0.0 0 0 ? S 08:43 0:00 [ksoftirqd/0]root 5 0.0 0.0 0 0 ? S< 08:43 0:00 [kworker/0:0H]root 7 0.0 0.0 0 0 ? S 08:43 0:03 [rcu_sched]
Description
User: The process belongs to the user account
%cpu: Percentage of CPU resources that the process uses
%MEM: Percentage of physical memory occupied by this process
VSZ: The amount of virtual memory that the process uses (Kbytes)
RSS: This process occupies a fixed amount of memory (Kbytes) that is: Process real memory (the size of the resident collection) KB
STAT: The current state of the program, ibid. ps-l s
Start: The time that the process was triggered to start
Command: The actual instruction of the program, same as Ps-l cmd
Linux View Process Command 2 (PS)