One of the Linux operating systems --------- command detailed analysis

  


To monitor and control a process, you must first understand the current process, that is, you need to view the current process, and the ps command is the most basic and very powerful process view command. Use this command to determine which processes are running and running, whether the process ends, whether the process is dead, which processes are taking up too many resources, and so on. In short, most of the information can be obtained by executing this command.
ps provides us with a one-time view of the process, and the results provided by it are not dynamically continuous; if you want to monitor the process time, you should use the top tool.
kill is used to kill the process.
1, ps parameter description
ps provides a lot of option parameters, commonly used are the following:
l long format output;
u display the process in the order of user name and start time;
j Use the task format to display the process;
f Display the process in a tree format;
a Display all processes of all users (including other users);
x Display the process without a control terminal;
r shows the running process;
ww avoids the detailed parameters being truncated;
Our common choice is that the combination is aux or lax, and the application of the parameter f.
2, ps aux or lax output explanation
USER process owner;
PID process ID;
PPID parent process;
%CPU process CPU percentage;
The percentage of memory occupied by %MEM;
The NICE value of the NI process, the value is large, indicating less CPU time;
VSZ process virtual size;
the number of pages in the RSS resident;
TTY terminal ID
STAT process state (there are several)
D can not be interrupted sleep (usually IO process);



R may be in the running The queue can be passed;
S is in hibernation;
T is stopped or tracked;
W enters memory swap (invalid from kernel 2.6);
X dead process (never Seen);
Z Zombie Process;
< High Priority Process
N Lower Priority Process
L Some pages are locked into memory;
s Process leader (There are child processes under it);
l Multi-process (using CLONE_THREAD, similar to NPTL pthreads);
+ process group in the background;
WCHAN waiting process resources;
START Time to start the process;
TI ME process consumes CPU time;
COMMAND command name and parameters;
3, application examples
[root@localhost ~]# ps -aux

Copyright © Windows knowledge All Rights Reserved