Linux ps command, linuxps
The ps command in Linux is short for Process Status. The ps command is used to list the processes currently running in the system. The ps command lists the snapshots of the current processes, that is, those processes that run the ps command at that time. If you want to dynamically display process information, you can use the top command.
There are 5 processes in linux
Ps command instructions
Ps [options]
The supported parameters are:
A. All processes are displayed.
-A: displays all programs on the same terminal.
-A: displays all processes.
C. display the real name of the process
-N Reverse Selection
-E equals to "-"
E. display environment variables
F. display the relationship between programs.
-H: Display Tree Structure
R displays the process of the current terminal
T display all programs of the current terminal
All processes of the user specified by u
-Au displays more detailed information
-Aux: Show All itineraries containing other users
-C <command> lists the status of a specified command
-Lines <number of lines> Number of lines displayed per page
-Width <Character Count> Number of characters displayed on each page
-Help: displays help information.
-Display version
Ps instance
Ps is a frequently used command and has many subtleties in practice.
View the PID of a running program
>>> ps -C fes_datasvr -o pid=17598
View the startup time of a running program
>>> ps -C fes_datasvr -o lstart,pid STARTED PIDMon Jun 1 15:59:57 2015 17598>>> ps -p 17598 -o lstart=Mon Jun 1 15:59:57 2015
View the uid, pid, stat, pri of the current system process, and sort them by uid.
>>>ps -eo pid,stat,pri,uid –sort uid
Through the above example, we can see that the content displayed by the-o parameter can be customized, and the options are separated by commas.