CentOS process Command Parsing
Name: ps
Permission: All Users
Usage: ps [options] [-- help]
Views: displays the dynamics of the instantaneous process.
Parameters: There are many ps parameters. Here, only a few common parameters are listed and their meanings are briefly described.
-A: List all processes.
-W display widening can display more information
-Au displays more detailed information
-Aux: Show All itineraries containing other users
######################################## ####################
Common parameters:
-A displays all processes (equivalent to-e) (utility)
-A displays all processes of a terminal, except session leads.
-N ignore selection.
-D: display all processes, but omit all session leads (utility)
-X: displays the processes that do not control the terminal and the specific path of each command. Dx cannot be used together. (Utility)
-P time when the pid process uses the cpu
-U uid or username: select a valid user ID or user name
-G gid or groupname: displays all processes in the group.
U username displays all processes under the user and detailed paths of each command. For example, ps U zhang; (utility)
-F is all listed. It is usually used with other options. For example, ps-fa or ps-fx and so on.
-L long format (including F, wchan, C, and other fields)
-J job format
-O User-Defined Format.
V is displayed in Virtual Memory Format
S is displayed in Signal Format
-M: Display All threads
-H: displays the process level (used with other commands, such as ps-Ha) (utility)
Environment (for example, ps-d e; ps-a e) (utility)
H does not show the first line
######################################## ####################
Common usage of ps commands (to facilitate viewing system processes)
1) ps a shows all programs under the current terminal, including those of other users.
2) ps-A displays all processes.
3) when listing programs in ps c, the real command name of each program is displayed without the path, parameter or resident service identifier.
4) the effect of this parameter is the same as that of the specified "A" parameter.
5) when listing programs, ps e displays the environment variables used by each program.
6) ps f uses ASCII characters to display the tree structure and express the relationship between programs.
7) the ps-H tree structure is displayed, indicating the relationship between programs.
8) ps-N shows all programs, except the programs under the ps command terminal.
9) ps displays the program status in the program signal format.
10) when listing programs in ps, it includes interrupted subroutines.
11) ps-t <terminal number> specifies the terminal number and lists the status of programs belonging to the terminal.
12) ps u displays the program status in user-based format.
13) ps x shows all programs, which are not distinguished by terminals.
The most common method is ps-aux. Then, a pipeline symbol is used to direct to grep to find a specific process and then operate on the specific process.
######################################## ####################
Run ps aux to the following information:
Root: # ps aux
User pid % CPU % MEM VSZ RSS TTY STAT START TIME COMMAND
Smmsp 3521 0.0 0.7 6556 1616? Ss 01:00:00 sendmail: Queue runner @ f
Root 3532 0.0 0.2 2428 452? Ss gpm-m/dev/input/mice-t imps2
Htt 3563 0.0 0.0 2956 196? Ss/usr/sbin/htt-retryonerror 0
Htt 3564 0.0 1.7 29460 3704? Sl htt_server-nodaemon
Root 3574 0.0 0.4 5236 992? Ss crond
Xfs 3617 0.0 1.3 13572 2804? Ss xfs-droppriv-daemon
Root 3627 0.0 0.2 3448 552? SNs anacron-s
Root 3636 0.0 0.1 2304 420? Ss/usr/sbin/atd
Listen 3655 0.0 0.5 13840 1084? Ssl dbus-daemon-1 -- system
Head header:
USER Username
UID User ID)
PID Process ID (Process ID)
PPID Parent Process ID (Parent Process id)
SID Session ID (Session id)
% CPU usage of cpu Processes
% MEM process memory usage
Virtual Size used by the VSZ Process)
The size of the resident set or actual memory used by the RSS process, in bytes of Kbytes.
TTY terminal associated with the process (tty)
STAT Process status: the status of the process is represented by characters (STAT Status Code)
R running Runnable (on run queue) is running or waiting in the running queue.
S sleep Sleeping is blocked during Sleeping, waiting for the formation or receipt of a signal of a certain condition.
I Idle
Z: the Zombie (a defunct process) process has been terminated, but the process descriptor exists until the parent process calls wait4 () and is released after the system call.
D. Uninterruptible sleep (usususally IO) does not wake up or run when the signal is received. The process must wait until an interruption occurs.
T Terminate the Terminate process and stop running after receiving signals from SIGSTOP, SIGSTP, SIGTIN, and SIGTOU.
P waiting for switch page
W no resident page has no resident pages does not have enough memory pages to allocate.
X Dead Process
<Process with high priority and high priority
N low-priority processes
L Memory Lock page Lock memory paging distribution and reduction in memory
S process leader (with sub-processes under it );
L multi-process (using CLONE_THREAD, similar to NPTL pthreads)
+ Process group in the background
START process START time and date
Total cpu TIME used by the TIME process
COMMAND is executing the COMMAND line COMMAND
NI priority (Nice)
PRI process Priority number (Priority)
The name of the kernel function in which the WCHAN process is sleeping. The name of the function is obtained from the/root/system. map File.
FLAGS: process-related numerical identification
######################################## ####################