The difference between ps-ef and PS aux under Linux

Source: Internet
Author: User
Tags posix

They are all used to display the currently running process, but:

PS aux is the BSD format to display the Java process
The items shown are: USER, PID,%cpu,%MEM, VSZ, RSS, TTY, STAT, START, Time, COMMAND
Ps-ef is the process of displaying Java in a standard format
The items shown are: UID, PID, PPID, C, Stime, TTY, Time, CMD

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

The PS command in Linux is the abbreviation for process status. The PS command is used to list those processes that are currently running on the system. The PS command lists the current snapshots of those processes, which are those that are executing the PS command at the moment, and if you want to display process information dynamically, you can use the top command.

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 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 is zombie, 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.
The KILL command is used to kill the process.

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 Sleeping
T stop traced or stopped
Z Zombie A defunct ("zombie") process

Specific parameters can refer to man PS or
Http://www.cnblogs.com/peida/archive/2012/12/19/2824418.html
The main discussion here is the difference between PS aux and ps–aux, and the difference between PS aux and ps–ef.

1. PS aux and Ps–aux
Man PS After the results obtained:
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 the "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 would is 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 are intended to aid in transitioning old scripts and habits. It is fragile, subject to change, and thus should not being relied upon.
it means:
Please note that "Ps-aux" differs from "PS aux". The standards for POSIX and UNIX require "Ps-aux" to print all processes for users named "X", and to print all the 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 intended to help transform old scripts and habits. It is fragile and is about to change and therefore should not be relied upon.
If you run Ps-aux >/dev/null, you will get the following line of warning message
Warning:bad PS syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html

Comprehensive: The use of the two direct selection of PS aux
Reference:
http://walkerxk.blog.sohu.com/150633165.html
http://blog.chinaunix.net/uid-24701781-id-3343264.html

2. PS aux and Ps-ef
the output of the two shows little difference, but the display style is different. Aux is BSD style,-ef is System V style. This is a minor difference, and one effect of using the difference is that aux truncates the command column , and-ef does not. This difference affects the results when combined with grep.
For example, please refer to: http://www.2cto.com/os/201303/197697.html

in total: The above three commands are recommended: Ps–ef

Original link: http://zoroeye.iteye.com/blog/2165233

The difference between ps-ef and PS aux under Linux

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.