Warning in Top 10 cpu consuming processes

I m using following command to find top 10 cpu consuming processes.
However whenever i execute the command i get
following warning.

What can be done to avoid it?

# ps -auxf | sort -nr -k 3 | head -10
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root     13494  0.1  0.5   9844  2824 ?        Ss   21:48   0:01  \_ sshd: root@pts/1
xfs       4694  0.0  0.3   3928  1700 ?        Ss   Aug09   0:00 xfs -droppriv -daemon
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
smmsp     4630  0.0  0.2   8048  1492 ?        Ss   Aug09   0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
rpc       4268  0.0  0.1   1808   604 ?        Ss   Aug09   0:00 portmap
root         7  0.0  0.0      0     0 ?        S<   Aug09   0:00 [kthread]
root         6  0.0  0.0      0     0 ?        S<   Aug09   0:00 [khelper]
root        52  0.0  0.0      0     0 ?        S<   Aug09   0:00  \_ [kseriod]
root      5115  0.0  0.2   2552  1108 ?        SN   Aug09   0:04 /usr/libexec/gam_server
root      5112  0.0  1.8  24428  9772 ?        SN   Aug09   0:00 /usr/bin/python -tt /usr/sbin/yum-updatesd

Please use just 'ps auxf' without the -

1 Like

Thanks you all for your reply .But i found it little strange as For giving an option to a command i normally use a hyphen "-" Why this is not the case with ps?
Is this a kind of bug?

Nope...You can the read the man page of ps to understand. Option 'a' is part of bsd syntax and doesnt really need a '-' before the option...

Confused, I think i m far behind to actually understand what does your statement means. However i m trying my level best to grab the linux technology.Thanks for your reply.

BSD is one of the oldest derivative of Unix operating system. BSD uses options with no dash. Recent forms of ps commands supports all three forms, no dash, single dash and double dashes...

Here is the statement from ps man page...

NAME
       ps - report a snapshot of the current processes.

SYNOPSIS
       ps [options]

DESCRIPTION
       ps displays information about a selection of the active processes. If you want a repetitive
       update of the selection and the displayed information, use top(1) instead.

       This version of ps accepts several kinds of options:
       1   UNIX options, which may be grouped and must be preceded by a dash.
       2   BSD options, which may be grouped and must not be used with a dash.
       3   GNU long options, which are preceded by two dashes.
1 Like

Thank you very much I have learned something new .