0

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
  • 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
3

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

3

BSD options to ps do not take a dash.

ps aux
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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