Lab environment: VMWare 7.0.0 build-203739
Operating System: Ubuntu 10.10
The ps command is used to display the process information at a certain time point, which is static. If you want to dynamically view the program information running in the current system, you can use the top command.
PS commands have many parameters, such as "-" and.
In the man's manual, the difference between PS-Aux and PS aux is described.
In POSIX and Unix standards, the PS-Aux command prints all processes belonging to the X user. If user X does not exist, PS-Aux will be interpreted as PS aux and a warning will be given.
The following is the running result of PS -- help. Let's take a look at this terrible parameter.
Among these many parameters, we often use a few. The following describes some commonly used commands.
- L long format output;
- U displays processes in the username and start time order;
- J. display processes in the task format;
- F process is displayed in a tree format;
- A. display all processes of all users (including other users );
- X displays the process of the uncontrolled terminal;
- R: displays running processes;
We should note that in medium,-l and l should mean one thing. They are all long output formats, but the actual situation is slightly different.
For example
We can see that the output results with "-" and without "-" are still different. This is a problem.
You can try other parameters.
It's a little far away. Let's start to introduce some common commands.
- List all programs running in the current Memory: PS aux
- List Parent and Child Processes
- List processes of a specified user
Show all information
Displays the parent-child relationship of all processes. We can see that ktheadd creates the following processes:
Lists the process information of a specified user as root.
========================================================== ========================================================== ======================================
The nasty title, so much information, the tiger's body was shocked, and the chrysanthemum was tight.
Let's introduce this information:
User process owner; PID process ID; ppid parent process ID; % CPU usage percentage of CPU processes; % mem memory usage; nice value of Ni process, large value, indicates that the CPU usage is relatively low; vsz Process Virtual size; Number of pages where RSS resides; resources that the wchan process is waiting for. If it is [-] indicates that the TTY terminal idstat process is running
D uninterruptible sleep (usually Io)
R is running and can be crossed in the queue;
S is in sleep state;
T stop or be tracked;
W enters the memory switch (it is invalid from kernel 2.6 );
X dead processes (never seen );
Z botnets;
<Process with high priority
N processes with lower priority
L some pages are locked into the memory;
S process leader (with sub-processes under it );
L is multi-threaded (using clone_thread, like nptl pthreads do)
+ Process group in the background;
The start time of the process;
Time the CPU time consumed by the process;
Command name and parameters;
To be continued