Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"ps aux" works but "ps -aux" doesn't

This might seem like a silly question but I haven't been able to find a clear answer.

This website states that the dash is optional in

ps aux

However, ps aux works but ps -aux brings up the error no user named 'x'. Any ideas what the issue may be here? Running Mac 10.8.2. Thanks

like image 724
Steve Avatar asked Feb 27 '13 01:02

Steve


People also ask

What does the command ps aux do?

The ps aux command is a tool to monitor processes running on your Linux system. A process is associated with any program running on your system, and is used to manage and monitor a program's memory usage, processor time, and I/O resources.

What is AUX in ps aux?

ps aux command options u:- This option shows user or owner column in output. x:- This option prints the processes those have not been executed from the terminal. Collectively the options "aux" print all the running process in system regardless from where they have been executed.

What is the difference between ps and ps aux?

There are no differences in the output because the meanings are the same. The difference between ps -ef and ps aux is due to historical divergences between POSIX and BSD systems. At the beginning, POSIX accepted the -ef while the BSD accepted only the aux form. Both list all processes of all users.

Which is PID in ps aux?

PID - The process ID. Usually, when running the ps command, the most important information the user is looking for is the process PID. Knowing the PID allows you to kill a malfunctioning process . TTY - The name of the controlling terminal for the process.


2 Answers

man ps

will give you this:

 The biggest change is in the interpretation of the -u option, which now
 displays processes belonging to the specified username(s).  Thus, "ps
 -aux" will fail (unless you want to know about user "x").  As a conve-
 nience, however, "ps aux" still works as it did in Tiger.
like image 89
zzk Avatar answered Oct 10 '22 20:10

zzk


Back in the day (from the late 1970s), there were basically two varieties of UNIX, the AT&T version from Bell Labs and the BSD version from UC Berkeley. The options to ps were different in the two versions. OS X now mostly conforms to the modern UNIX standard which follows the AT&T options to ps. But since the BSD ps didn't require a leading '-' option and so many people were used to typing 'ps aux', Apple has decided to leave that sequence with its original BSD interpretation.

like image 29
rhashimoto Avatar answered Oct 10 '22 19:10

rhashimoto