Differences between ps aux, ps-aux, and ps-ef in Linux:-aux-ef

Source: Internet
Author: User

Differences between ps aux, ps-aux, and ps-ef in Linux:-aux-ef

The ps command in Linux is short for Process Status. The ps command is used to list the processes currently running in the system. The ps command lists the snapshots of the current processes, that is, those processes that run the ps command at that time. If you want to dynamically display process information, you can use the top command.

To monitor and control processes, you must first understand the current process, that is, you need to view the current process, and the ps command is the most basic and very powerful process viewing command. You can use this command to determine which processes are running and running, whether the process is terminated, whether the process is dead, and which processes are occupying excessive resources. In short, most of the information can be obtained by executing this command.

Ps provides a one-time View of the process. The results are not dynamically consecutive. To monitor the process time, use the top tool.

The kill command is used to kill a process.

There are five processes in linux:

1. Run (running or waiting in the running Queue)

2. interruption (in sleep, blocked, waiting for the formation of a condition or receiving a signal)

3. Do not interrupt (do not wake up when receiving the signal or do not run, the process must wait until there is an interruption)

4. Stiff (the process has been terminated, but the process descriptor exists until the parent process calls wait4 () and is released after the system call)

5. Stop (the process stops running after receiving signals from SIGSTOP, SIGSTP, SIGTIN, and SIGTOU)

Five status codes used by the PS tool to identify a process:

D. uninterruptible sleep (usually IO) cannot be interrupted)

R run runnable (on run queue)

S interrupt sleeping

T stop traced or stopped

Z dead a defunct ("zombie") process

For specific parameters, see man ps or

Http://www.cnblogs.com/peida/archive/2012/12/19/2824418.html

Here we will focus on the differences between ps aux and ps-aux, and the differences between ps aux and ps-ef.

1. ps aux and ps-aux

Result obtained after man ps:

Ps displays information about a selection of the active processes. If you want a repetitive update of the selection and the displayed information, use top (1) instead.

Note that "ps-aux" is distinct from "ps aux ". the POSIX and UNIX standards require that "ps-aux" print all processes owned by a user named "x", as well as printing all processes that wocould be selected by the-a option. if the user named "x" does not exist, this ps may interpret the command as "ps aux" instead and print a warning.

This behavior is intended to aid in transitioning old scripts and habits. It is fragile, subject to change, and thus shocould not be relied.

Meaning:

Note that "ps-aux" is different from "ps aux ". POSIX and UNIX standards require "ps-aux" to print all processes of a user whose username is "x", and to print all processes that will be selected by the-a option. If the user name "x" does not exist, ps will be interpreted as "ps aux" and a warning will be printed. This behavior is used to help convert old scripts and habits. It is fragile and will be changed soon, so it should not be dependent.

If you run ps-aux>/dev/null, you will get the following line of warning information:

Warning: bad ps syntax, perhaps a bogu'-'See http://procps.sf.net/faq.html

To sum up, you can directly select ps aux between the two.

2. ps aux and ps-ef

There is little difference between the two output results, but the display style is different. Aux is BSD and-ef is System V. This is a secondary difference. The difference that affects usage is that aux truncates the command column, but-ef does not. When grep is combined, this difference affects the result.

To sum up, we recommend the following three commands: ps-ef.

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.