“ps aux” works but “ps -aux” doesn't

╄→гoц情女王★ 提交于 2019-12-21 03:32:39

问题


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


回答1:


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.



回答2:


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.



来源:https://stackoverflow.com/questions/15102576/ps-aux-works-but-ps-aux-doesnt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!