您的位置:首页 > 其它

Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ

2013-03-11 09:14 831 查看
以前一直在AIX系统下玩,今天无意在linux下运行一个命令,出现如下错误:

[root@erpdemo ~]# ps -aux

Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ

htc       3844  0.0  0.2   3884   676 pts/0    R+   09:11   0:00 grep nfs

……

奇怪?这个命令在AIX下运行一点也没有问题,提示语法错误? 看来命令书写有错误,ksh和bash的区别吗?然后换一种方式

[root@erpdemo ~]# ps aux

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND 

root         1  0.0  0.0  10344   684 ?        Ss    2010   1:33 init [3]                             

root         2  0.0  0.0      0     0 ?        S<    2010   0:01 [migration/0]

我们继续去分析问题,man ps

EXAMPLES 

To see every process on the system using standard syntax

   ps -e 

   ps -ef 

   ps -eF 

   ps -ely

To see every process on the system using BSD syntax

   ps ax 

   ps axu

a               Lift the BSD-style "only yourself" restriction, which is imposed upon the set of all processes when some BSD-style (without "-") 

                options are used or when the ps personality setting is BSD-like. The set of processes selected in this manner is in addition to 

                the set of processes selected by other means. An alternate description is that this option causes ps to list all processes with a 

                terminal (tty), or to list all processes when used together with the x option.

<EOF>

参考:warning:bad syntax,perhaps a bogus .....
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: