下面的命令是working on 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.没有各自的命令
发布于 2015-09-18 10:36:36
在变量$0中,您有不同的值,在ubuntu "bash“中,在centOS "-bash”中,因此它认为必须有一些选项
发布于 2015-09-18 12:04:57
您也可以尝试下面的方法,因为它将剔除您不想要的其他结果:
ps ax | grep cqc_script_master_76.p[y]https://stackoverflow.com/questions/32649788
复制相似问题