In Linux, ps is the abbreviation of "Process Status", which is a command to monitor the process. Through this command, you can view the detailed information of all running processes in the system, such as the running status of the process, whether the process has ended, and the process Are there any zombies, which processes occupy too many resources, etc.; the syntax is "ps [options] [--help]". ps displays the status of the instant process and does not dynamically monitor the status in real time.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer. The
ps (abbreviation for Process Status) command is the most commonly used command to monitor processes in Linux. Through this command, you can view detailed information about all running processes in the system.
Use the ps command to see which processes are running, and you can also see the running status of the process, whether the process has ended, whether the process has died, which processes are occupying too many resources, etc. In short, most of the information can be obtained by executing this command.
ps displays the status of the instant process and is not dynamic and continuous. If you want to monitor the process in real time, you should use the top command.
The format of the ps command is:
ps [选项] [--help]
Commonly used option parameters of the ps command are:
Option | Function |
-A | Display all processes, the same effect as -e |
-a | Display All processes under the current terminal, including processes of other users |
-u | Display the process status of the current user |
-x | is usually used together with the a parameter to list more complete information |
-l | Longer and more detailed The PID information is listed |
-j | jobs format |
-f | Display all information about the process |
-e | means display all inheritance |
Common format:
ps aux #查看系统中所有的进程,使用 BS 操作系统格式 ps -le #查看系统中所有的进程,使用 Linux 标准命令格式
Example:
ps -aux
The default is unordered and can be sorted by the --sort command, such as: sorting in descending order according to cpu usage:
➜ test ps -aux --sort -pcpu|less -N #按照cpu占用来排序 ➜ test ps -aux --sort -pmem|less -N #按照内存占用来排序
View the specified process, such as viewing the php process:
ps -ef | grep php
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of What is the abbreviation of linux ps?. For more information, please follow other related articles on the PHP Chinese website!