Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I attempt to run the command ps with the flags/switches/options aux I get the following message. If I run the command without grep, no message is displayed. What am I doing wrong?

ps -aux | grep 'skype'
Warning: bad ps syntax, perhaps a bogus '-'? 
See http://procps.sf.net/faq.html
share|improve this question
    
Wait, did you even read the link you posted? It answers your question. –  Dr Kitty Feb 27 '12 at 5:26
    
@The Electric Muffin - I did however don't understand when it states 'x' refers to a specific user. –  PeanutsMonkey Feb 27 '12 at 5:42
    
@The Electric Muffin - Does it mean I can run the command ps -aux{username}? –  PeanutsMonkey Feb 27 '12 at 5:50
    
The -u username switch selects processes belonging to username, so ps -upeanuts would select every process belonging to the user peanuts. –  Dr Kitty Feb 29 '12 at 3:31
add comment

2 Answers 2

up vote 3 down vote accepted

It should (and did for me) display that warning whether or not it's piped to grep. The real issue is the -aux switch. The manpage says:

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 would 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."

share|improve this answer
add comment

BSD options to ps do not take a dash.

ps aux
share|improve this answer
    
I understand that however what is the difference between ps -aux and ps aux –  PeanutsMonkey Feb 27 '12 at 5:48
    
One is incorrect and the other is correct. –  Ignacio Vazquez-Abrams Feb 27 '12 at 5:49
    
But why is that? Does x refer to the username of a user? –  PeanutsMonkey Feb 27 '12 at 5:50
    
x is a BSD-style option. –  Ignacio Vazquez-Abrams Feb 27 '12 at 5:51
    
Sorry for being a n00b but what does that mean? –  PeanutsMonkey Feb 27 '12 at 6:16
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.