Detailed explanation of ps command

The ps command is used to report the process status of the current system. Can be used with the kill command to interrupt and delete unnecessary programs at any time. The ps command is the most basic and also a very powerful process viewing command. Using this command, you can determine which processes are running and their running status, whether the process has ended, whether the process is dead, which processes are taking up too many resources, etc. In short Most of the information can be obtained by executing this command.

grammar

ps(options)

Options

-a: Display programs executed under all terminals except the stage job leader.
a: Display all programs under the current terminal, including programs of other users.
-A: Display all programs.
-c: Display the CLS and PRI fields.
c: When listing programs, display the real command name of each program, without the path, option or resident service designation.
-C<command name>: Specifies the name of the execution command and lists the status of the program that executes the command.
-d: Display all programs, excluding those of the stage job leader.
-e: This option has the same effect as specifying the "A" option.
e: When listing programs, display the environment variables used by each program.
-f: Display UID, PPIP, C and STIME fields.
f: Display the tree structure with ASCII characters to express the relationship between programs.
-g<group name>: The effect of this option is the same as specifying the "-G" option, and it can also be specified using the name of the stage job leader.
g: Display all programs under the current terminal, including the program of the group leader.
-G<group ID>: List the status of the programs belonging to the group, and can also use the group name to specify.
h: Do not display the title bar.
-H: Display a tree structure, indicating the relationship between programs.
-j or j: Display program status in job-controlled format.
-l or l: Display program status in verbose format.
L: List the relevant information of the field.
-m or m: Display all threads.
n: The USER and WCHAN fields are represented by numbers.
-N: Display all programs, except the programs under the ps command terminal.
-p<program ID>: Specifies the program ID and lists the status of the program.
p<program ID>: The effect of this option is the same as specifying the "-p" option, with only a slight difference in the list format.
r: List only the programs currently being executed by the current terminal.
-s <stage job>: Specifies the program identifier of the stage job, and lists the status of the programs that belong to the stage job.
s: Display the program status in the format of program signal.
S: When listing programs, include interrupted subroutine data.
-t <terminal number>: Specifies the terminal number and lists the status of the programs belonging to the terminal.
t<terminal number>: The effect of this option is the same as specifying the "-t" option, only the list format is slightly different.
-T: Display all programs under the current terminal.
-u<user ID>: The effect of this option is the same as specifying the "-U" option.
u: Display the program status in a user-based format.
-U<user ID>: List the status of programs belonging to this user, and can also be specified by user name.
U<username>: Lists the status of programs belonging to this user.
v: Displays program status in virtual memory format.
-V or V: Display version information.
- w or w: Display program status in a wide format. 
x: Display all programs, not differentiated by terminal.
X: Displays program status in the old Linux i386 login format.
-y: When used with the option "-l", the F(flag) field is not displayed, and the ADDR field is replaced by the RSS field.
-<Program ID>: This option has the same effect as specifying the "p" option.
--cols<characters per column>: Set the maximum number of characters per column.
--columns <number of characters per column>: This option has the same effect as specifying the "--cols" option.
--cumulative: This option has the same effect as specifying the "S" option.
--deselect: This option has the same effect as specifying the "-N" option.
--forest: This option has the same effect as specifying the "f" option.
--headers: Repeat the header column.--help 
: Online help.--info 
: Display debugging information.
--lines<display number of columns>: Set the number of columns of the display screen.
--no-headers: This option has the same effect as specifying the "h" option, with a slight difference in the list format.
--group <group name>: This option has the same effect as specifying the "-G" option.
--Group<group ID>: The effect of this option is the same as specifying the "-G" option.
--pid <program ID>: This option has the same effect as specifying the "-p" option.
--rows <number of display columns>: This option has the same effect as specifying the "--lines" option.
--sid <stage job>: This option has the same effect as specifying the "-s" option.
--tty<terminal number>: This option has the same effect as specifying the "-t" option.
--user<username>: This option has the same effect as specifying the "-U" option.
--User<user ID>: This option has the same effect as specifying the "-U" option.
--version: This option has the same effect as specifying the "-V" option.
--widty<characters per column>: This option has the same effect as specifying the "-cols" option.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324908981&siteId=291194637