Linux – ps warns me about bad syntax with “aux” options

linuxps

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

Best Answer

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

Related Question