linux - CentOS 中的替代命令

标签 linux shell grep

以下命令在 Ubuntu工作

iv2user@ubuntu-serverA1:~$ ps ax | grep -v grep | grep -v $0 | grep script_master_01.py
20656 pts/2    S+     0:00 python script_master_01.py

我在哪里运行 py 文件,如 python script_master_01.py

但是在 CentOS 6.5 上命令不工作

[iv2user@dev3 ~]$ ps ax | grep -v grep | grep -v $0 | grep cqc_script_master_76.py
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.

你能帮我吗,因为我没有 CentOS 的相应命令。

最佳答案

您也可以尝试以下方法,因为它会清除您不想要的其他结果:

ps ax | grep cqc_script_master_76.p[y]

关于linux - CentOS 中的替代命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32649788/

相关文章:

c++ - Emacs 大括号和括号突出显示?

bash - shell脚本中自动应答ssh-copy-id

android - 如何从android代码启动 "uiautomator test run"?

python - 通过搜索unix中的所有目录来编译值列表

linux - 如何重定向在运行 'tail -f' 和 'grep' 的终端中键入的输入?

linux - 如何从日志文件中删除日志信息(时间戳等)

php - UTF-8贯穿始终

c++ - 这段代码有什么问题?

bash source 文件末尾有一个退出命令

regex - 如何在 Perl 中模拟 'grep -B' 功能?