当前位置:首页 > Liunx教程 >

Linux命令Warning: bad syntax, perhaps a bogus '-'?

发布时间:2024-06-03 12:24:24 作者:佚名 阅读:(8)

在服务器上执行ps命令的时候提示Warning: bad syntax, perhaps a bogus '-'?,看到这个提示很多小伙伴不知道如何解决,接下来云梦编程为大家介绍一下Warning: bad syntax, perhaps a bogus '-'?的解决方法,有需要的小伙伴可以参考一下:

Linux命令Warning: bad syntax, perhaps a bogus -?

1、错误提示:

[root@kjserver ~]# ps -aux | grep svn
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ

Linux命令Warning: bad syntax, perhaps a bogus -?

2、错误原因:

    查看提示里面的文档,发现给出了一些原因。

Why does "ps -aux" complain about a bogus '-'?

According to the POSIX and UNIX standards, the above command asks to display
all processes with a TTY (generally the commands users are running) plus all
processes owned by a user named "x". If that user doesn't exist, then ps will
assume you really meant "ps aux". The warning is given to gently break you of a
habit that will cause you trouble if a user named "x" were created.

3、解决方法:

    (1)、官方给的解决方法:

No ps release has ever had this problem. Most likely your system has been
broken into. You might want to install a more recent version of the OS. If
you'd rather take your chances, simply upgrade procps.

    (2)、亲测可用:

    把命令中的“-”去掉再去执行命令即可

ps aux | grep svn

Linux命令Warning: bad syntax, perhaps a bogus -?

以上就是云梦编程为大家带来的Warning: bad syntax, perhaps a bogus '-'?的解决方法的全部内容了,希望对大家有所帮助,按照上面方式就可以解决,了解更多相关文章请关注云梦编程网!

© 2023 - 云梦编程网 版权所有 鲁ICP备2021017318号-4