PS of Linux commands

Source: Internet
Author: User

Overview

Sometimes the system administrator may only be concerned about which programs are running on the system and don't want to know which processes are running. Because an application may need to start multiple processes. So in the same situation, the number of processes is much more than the procedure. Use PS to determine which processes are running and running, whether the process is complete, if the process is dead, which processes are consuming too much resources, and so on.

-A show all processes (equivalent to-e) (utility)
-a displays all processes of a terminal, in addition to session leader
PS C shows the actual instruction name of each program when the program is listed, not including the path, parameter, or indication of the resident service.

The most common approach is to Ps-aux, and then use a pipe symbol to direct to grep to find a specific process and then manipulate the specific process.

Explain

The nice value of the NI process, which is large, means that it consumes less CPU time;

The total CPU time used by the duration process
The size of the virtual memory used by the VSZ process (virtual size)
The size of the resident set used by the RSS process, or the size of the actual memory, Kbytes bytes
Status of the stat process: process State is represented by a character (stat's status code)
R runs Runnable (on Run queue) is running or waiting in the run queue.
S sleep sleeping dormant, obstructed, waiting for a condition to form or receive signals.
I Free Idle
The Z Zombie Zombie (a defunct process) session has been terminated, but the process descriptor exists until the parent process calls the WAIT4 () system call and releases.
D non-interruptible uninterruptible sleep (ususally IO) receives a signal that does not wake up and is not operational, and the process must wait until an interrupt occurs.
D a dormant state (usually IO process) that cannot be interrupted;
T terminates the Terminate process to receive sigstop, SIGSTP, Sigtin, and Sigtou signals after it stops running.
P Wait for Exchange page
W no-resident page has no resident pages there is not enough memory paging to allocate.
X dead Process
< high-priority process
N low-priority process with lower priority sequence
L Memory Lock page lock has memory paging allocated and shrunk in memory body
Leader of the S-process (under it there are sub-processes);
L multi-process (using Clone_thread, similar to NPTL pthreads)
+ process groups in the background

[[Email protected] ~]# PS aux|grep D
The TTY should be running on that end (the terminal position of the landing), if it is not relevant to the end, it is displayed (? )。 If the pts/0, it means that the network connects the host
Wchan If the previous process is in progress, if-that means it is in progress;
Start time the process is initiated;
The time that the process actually uses the CPU to run the line;
The name and parameters of the command commands;

Stat-state frequently-used state characters

D a dormant state (usually IO process) that cannot be interrupted;
R is running can be in the queue can be too line;
S is in a dormant state;
T stop or be traced;
W enters memory swap (invalid starting from kernel 2.6);
X dead process (basic rarely seen);
Z Zombie process;
< high-priority processes
N Low-priority processes
L Some pages are locked into memory;
Leader of the S-process (under it there are sub-processes);
L multi-process (using Clone_thread, similar to NPTL pthreads);
+ Process Group located in the background;

examples :
View the uid,pid,stat,pri of the current system process, sorted by UID number.
Ps-eo Pid,stat,pri,uid--sort UID
View the User,pid,stat,rss,args of the current system process, sorted by RSS.
Ps-eo User,pid,stat,rss,args--sort RSS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.