PS commands for Linux Process Management

Source: Internet
Author: User

Lab environment: VMWare 7.0.0 build-203739

Operating System: Ubuntu 10.10

The ps command is used to display the process information at a certain time point, which is static. If you want to dynamically view the program information running in the current system, you can use the top command.

PS commands have many parameters, such as "-" and.

In the man's manual, the difference between PS-Aux and PS aux is described.

In POSIX and Unix standards, the PS-Aux command prints all processes belonging to the X user. If user X does not exist, PS-Aux will be interpreted as PS aux and a warning will be given.

The following is the running result of PS -- help. Let's take a look at this terrible parameter.

Among these many parameters, we often use a few. The following describes some commonly used commands.

 
  • L long format output;
  • U displays processes in the username and start time order;
  • J. display processes in the task format;
  • F process is displayed in a tree format;
  • A. display all processes of all users (including other users );
  • X displays the process of the uncontrolled terminal;
  • R: displays running processes;

We should note that in medium,-l and l should mean one thing. They are all long output formats, but the actual situation is slightly different.

For example

We can see that the output results with "-" and without "-" are still different. This is a problem.

You can try other parameters.

It's a little far away. Let's start to introduce some common commands.

  1. List all programs running in the current Memory: PS aux
  2. List Parent and Child Processes
  3. List processes of a specified user

Show all information

Displays the parent-child relationship of all processes. We can see that ktheadd creates the following processes:

Lists the process information of a specified user as root.

========================================================== ========================================================== ======================================

The nasty title, so much information, the tiger's body was shocked, and the chrysanthemum was tight.

Let's introduce this information:

User process owner; PID process ID; ppid parent process ID; % CPU usage percentage of CPU processes; % mem memory usage; nice value of Ni process, large value, indicates that the CPU usage is relatively low; vsz Process Virtual size; Number of pages where RSS resides; resources that the wchan process is waiting for. If it is [-] indicates that the TTY terminal idstat process is running
    D uninterruptible sleep (usually Io)
    R is running and can be crossed in the queue;
    S is in sleep state;
    T stop or be tracked;
    W enters the memory switch (it is invalid from kernel 2.6 );
    X dead processes (never seen );
    Z botnets;
    <Process with high priority
    N processes with lower priority
    L some pages are locked into the memory;
    S process leader (with sub-processes under it );
    L is multi-threaded (using clone_thread, like nptl pthreads do)
    + Process group in the background;

The start time of the process;
Time the CPU time consumed by the process;
Command name and parameters;

To be continued

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.