Linux command ps aux|grep xxx detailed

Source: Internet
Author: User

This digest from: https://www.cnblogs.com/longshiyVip/p/4890181.html

To monitor and control the process, you must first understand the current process, that is, you need to see the current process, and the PS command (ProcessStatus) is the most basic and very powerful process view command.

Use this command to determine which processes are running and running, whether the process is complete, if the process has no zombies, which processes are consuming too many resources, and so on. In short, most of the information can be obtained by executing the command.

PS gives us a one-time view of the process, it provides a view of the results is not dynamic continuous, if you want to monitor the process, you should use the top tool.

If you use the PS command directly, the status of all processes is displayed, usually in conjunction with the grep command to see the status of a process.

grep (Global Search Regular expression (RE) and print out of the line, Full search of regular expressions and printing of rows is a powerful text-search tool that can use regular expressions to search for text and print matching lines.

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. ps-t< Terminal number > Specify the terminal number, and list the status of the program belonging to the terminal. PS U Displays the status of the program in a user-oriented format. PS x Displays all programs and does not differentiate by terminal.

Examples of Use:

run PS aux to the following information:

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 state of the trip

Start: Trip start time

Time: When it was executed

Command: the command executed

There are 5 states of processes on Linux:

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 SleepingT stop traced or stoppedZ Zombie A defunct ("zombie") process

< high-priority processes

N Low-priority processesL 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;Wchan The process resources being awaited;

Linux command ps aux|grep xxx detailed

Related Article

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.