PS Command usage

Source: Internet
Author: User

PS command

Function: Used to display the process dynamic information that is running on the current system.

Parameters:

-A: List all processes (equivalent to-e)

-A: Displays all processes running at the current terminal.

E: When listing programs, show each program is the user's environment variable

U: Show program status in user-oriented format

x: Show all processes, not the terminal to distinguish

L: Long format output

-O: Control output


Output format:

User: Username

PID: Process ID

UID: User ID

PPID: Process ID of the parent process

SID: Session ID

%CPU: CPU utilization of the process

%MEM: Memory usage of the process

VSZ: The size of the virtual memory used by the process

RSS: Memory size when the process is using

TTY: terminal associated with a process

STAT: Status of the process

START: Total CPU time for process operations

Time: How long the process has been running

Command: In-line command execution

NI: Priority PRI: Process priority number

Wchan: Process is sleeping kernel parameter name

FLAGS: Digital ID of the process


The process status is detailed:

R: Running or waiting in the running queue

S: Dormant, waiting for a condition to form or receive a signal

Z: Zombie, the process has terminated, but the process descriptor exists until the parent process calls the WAIT4 () system call to release

D: Received signal does not wake up and not run, golden winged birds must wait until interrupted by interrupts

T: Terminate, process stops running after receiving Sigstop,sigstp,sigtin,sigtou signal

W: Not enough memory paging to allocate

X: Dead Process

<: high-priority processes

N: Low-priority processes

L: Memory lock page, which is allocated by memory paging and indented in the memory body

S: Leader of the process (under it child process)

L: Multi-process

+: Process groups in the background


    1. The difference between ps-aux and PS aux is ps-aux to print all processes for users named "X", and to print all processes that will be selected by the-a option. If the user "X" does not exist, it will be interpreted as "PS aux" by the editor and a warning will be printed.

      When running "Ps-aux >/dev/null", the following warning message is displayed;

      Warning:bad syntax, perhaps a bogus '-'? See/usr/share/doc/procps-3.2.8/faq

      Therefore, it is best to use the "PS aux" command directly.

    2. PS aux and Ps-ef

      The Aux truncates the command column, and-ef does not, when combined with grep, affects the result.

    3. Ps-u Users

      Displays the process for the specified user

    4. Sort Display

      Ps-aux--sort-pmem | Head-n 10

    5. PS-C Process Name

      Displays the specified process

    6. Ps-l PID

      Displays the specified process according to the PID

    7. Pstree

      Show Process Tree


This article is from the "Different Skies" blog, so be sure to keep this source http://jiekeyang.blog.51cto.com/11144634/1770211

PS Command usage

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.