Linux under the PS command Detailed (turn) __linux

Source: Internet
Author: User
Tags cpu usage

To monitor and control processes in the system, view status, memory, CPU usage, and use commands:/bin/ps

(1) PS: is to show the status of instantaneous process, not dynamic continuous;

(2) Top: If you want to monitor the process running time, you should use the top command;

(3) Killing is used to kill a process or send a signal to a process;

(4) View the last man manual of the article, you can view the meaning of each output of PS, to Find:standard FORMAT specifiers

===================================ps parameter Description =============================

l long format output;

U displays the process in the order of user name and start time;

J Use task format to display process;

F to display the process in a tree format;

A displays all processes for all users (including other users);

X shows the process of the uncontrolled terminal;

R shows the running process;

WW avoids detailed parameters being truncated;


-A lists all processes
-W display widens to show more information
-au displays more detailed information
-aux shows all processes that contain other users

-e Displays all processes, environment variables
-F Full format
-H does not display title
-L Long format
-W Wide output
A shows all processes on the terminal, including other user processes
R shows only running processes
X shows no control over terminal process

Our common option is the combination of aux or lax, and the application of parameter F.
PIDs lists only process identifiers, separated by commas. The process list must be given immediately after the last option of the command-line argument, with no spaces inserted in the middle. For example: ps-f1,4,5 shows processes with process ID 1,4,5

The long command-line options are described below, which use the "--" Start:
--sort x[+|-] key [, [+|-] key [,...]] Select a multiple letter key from the Sort keys section. " The + character is optional, because the default direction is in ascending numeric or dictionary order, and the "-" character is sorted in reverse order (that is, descending).

For example: Ps-jax-sort=uid,-ppid,+pid.
--HELP Displays help information.
--version Displays the version information for this command.

The sort key is mentioned in the previous option description, and the sort key is further explained. It needs to be noted that the use of the value in the sort is the internal value of the PS application, not just the pseudo value in some output formats. The sort key list is shown in the following table.

============ sort Key List ==========================
C cmd executable simple name
C cmdline complete command line
F Flags Long Mode logo
G PGRP Process Group ID
G Tpgid Control TTY process group ID
J Cutime Cumulative User Time
J Cstime Cumulative system time
K Utime User Time
K stime System Time
M Min_flt Secondary page wrongly quantity
M Maj_flt Key page wrongly number
n Cmin_flt Cumulative Secondary page error
N Cmaj_flt Cumulative Key page error
o Session Dialog ID
P PID Process ID
P PPID Parent Process ID
R RSS Resident Size
R Resident Resident Page
s size RAM (kilobytes)
S share number of shared pages
T TTY TTY minor device number
T start_time Process Start time
U UID UID
U user username
V vsize Total Virtual Memory quantity (bytes)
Y Priority Kernel scheduling priority
Interpretation of ========================================ps aux or lax output =========================

2, PS aux or lax output interpretation

AU (x) output format:
USER PID%cpu%mem VSZ RSS TTY STAT START time COMMAND

USER: Process Owner
PID: Process ID

%CPU: Utilization of CPU usage
%mem: Memory consumption usage
VSZ: Amount of virtual memory consumed
RSS: Size of memory consumed

TTY: Secondary device number for the terminal (minor device numbers of TTY)

STAT: Process Status:

Start: The time the process was started;
Time: The process consumes CPU times;
Command: The name and parameters of the order;

========================================= Process Stat State ==================================

D the dormant state (usually IO process) which cannot be interrupted;
R is running in an interruptible queue;
S is dormant, still state;
T stop or be traced, suspend execution;
W enters memory Exchange (invalid starting from kernel 2.6);
X dead process;
The Z zombie process does not exist but cannot be eliminated for the time being;

W: Not enough memory paging to allocate
Wchan is waiting for the process resources;

High-priority processes
N: Low Priority sequence process
L: Memory paging allocation and lock in memory (instant system or endure a I/O), that is, some pages are locked into memory

The leader of the S process (under it there are sub processes);
L multi-process (using Clone_thread, similar to NPTL pthreads);
+ The process group located in the background;

========================================kill Terminate Process ================================

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.