ChinaUnix.net
相关文章推荐:

pidof

I copied from other place and it's a very useful tool. ================================================= #!/usr/bin/env python import os import sys import re if len(sys.argv) != 2: #print >> sys.stderr, "Provide one (and one only) pattern to match." sys.exit(1) ps = os.popen('ps -e') ps.readline() #-- To eliminate initial line for line in ps: try: match = re.search(r"%s" % ...

by gtaww - Solaris - 2006-08-31 12:05:34 阅读(1116) 回复(1)

相关讨论

用来查找指定进程是否存在,非常好用,以后就不用非得 ps | grep了,嘎嘎, 今天才发现,看来linux基础不及格啊

by isnowran - C/C++ - 2013-04-18 16:40:17 阅读(7639) 回复(25)

如题,管道:/sbin/pidof xxx | sar 2 5 -x >> result 为啥不对呢? 目的是想根据名字的到一个进程ID然后监视这个进程并写如文件。 请高人帮忙看一下。谢谢了。

by qjwyk - Shell - 2008-11-08 19:55:41 阅读(1251) 回复(2)

各位老大.我不是很熟shell,请教一下,我用命令pidof 的到进程的 id ,但不知道怎么将结果存在变量里

by hxdhxd_hxd - Shell - 2005-10-14 18:20:28 阅读(2085) 回复(2)