Linux under the PS command details of the Linux under the PS command detailed use method

Source: Internet
Author: User
Tags cpu usage

Linux under the PS command detailed

1. Running (running or waiting in the running queue)

2. Interrupt (dormant, blocked, waiting for a condition to form or receive a signal)

3. Non-interruptible (receive signal does not wake up and not run, process must wait until interrupt occurs)
4. Zombie (The process has been terminated, but the process descriptor exists until the parent process calls WAIT4 () after the system call is released)
5. Stop (process received Sigstop, SIGSTP, Sigtin, Sigtou signal after stop running run)
PS Tool identifies 5 status codes for the process:
D non-interruptible uninterruptible sleep (usually IO)
R run runnable (on run queue)
S Interrupt Sleeping
T stop traced or stopped
Z Zombie a defunct ("zombie") process
Name: PS
Usage rights: All users
How to use: PS [options] [--help]
Description: Shows the dynamics of the instantaneous stroke (process)
Parameters:
The parameters of PS are very numerous, and only a few commonly used parameters are listed here and the meaning is roughly
-A lists all trips
-W display widen to show more information
-au Show more detailed information
-aux Show all itineraries that contain other users
AU (x) output format:
USER PID%cpu%MEM VSZ RSS TTY STAT START time COMMAND
User: Owner of the itinerary
Pid:pid
%CPU: CPU Usage consumed
%MEM: Usage of memory consumed
VSZ: Virtual Memory size occupied
RSS: Size of memory consumed
TTY: Secondary device number for the terminal (minor device numbers of TTY)
STAT: The status of the trip:
D: Non-interruptible static
R: Executing in progress
S: Stationary state
T: Pause execution
Z: Not present but cannot be eliminated temporarily
W: Not enough memory paging to allocate
<: High-priority stroke
N: Low-priority stroke
L: Memory paged and locked in memory (instant system or I/O)
Start: Trip start time
Time: When it was executed
Command: the command executed
Example:
Ps
PID TTY Time CMD
2791 ttyp0 00:00:00 tcsh
3092 Ttyp0 00:00:00 PS
% ps-a
PID TTY Time CMD
1? 00:00:03 Init
0} 00:00:00 kflushd
3? 00:00:00 Kpiod
6} 00:00:00 KSWAPD
5? 00:00:00 Mdrecoveryd
.......
% Ps-aux
USER PID%cpu%MEM VSZ RSS TTY STAT START time COMMAND
Root 1 0.0 0.7 1096 472? S Sep10 0:03 init [3]
Root 2 0.0 0.0 0 0? SW SEP10 0:00 [kflushd]
Root 3 0.0 0.0 0 0? SW SEP10 0:00 [Kpiod]
Root 4 0.0 0.0 0 0? SW SEP10 0:00 [KSWAPD]
The specific commands are explained as follows:
1) PS A shows all the programs under the current terminal, including other users ' programs.
2) ps-a Show All Programs.
3) PS C lists the program, displays the actual instruction name of each program, and does not include the path, parameter or the indication of the resident service.
4) Ps-e The effect of this parameter is the same as specifying the "A" parameter.
5) When listing the program, PS e displays the environment variables used by each program.
6) PS F Displays the tree structure with ASCII characters, expressing the relationship between the programs.
7) ps-h shows the tree structure, indicating the relationship between the programs.
8) Ps-n shows all the programs except the program under the PS Command Terminal.
9) PS s uses the program signal format to display the program status.
PS S when listing programs, including interrupted sub-program data.
One) ps-t< terminal number >
Specify the terminal number and list the status of the program that belongs to the terminal.
PS u
Displays the status of the program in a user-oriented format.
PS X
Show All programs, do not differentiate by terminal.
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.

Linux under the PS command details of the Linux under the PS command detailed use method

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.