当前位置:网站首页>grep查找进程时,忽略grep进程本身
grep查找进程时,忽略grep进程本身
2022-07-06 18:05:00 【Channing Lewis】
ps -ef | grep '进程名' | grep -v grep
grep -v grep即去除结果中含有grep的进程。
但是要注意如果你的进程名中本身含有grep也会被忽略。
这时就需要更细致的规则,例如去除条件里加上一个空格:
ps -ef | grep '进程名' | grep -v 'grep '
因为grep进程是以grep+空格开头的,而一般进程不会这样,所以可以区分。
如果还区分不了可以考虑grep -v支持的正则表达式写法,这里不再赘述。(因为实在太罕见了)
边栏推荐
- Taro2.* 小程序配置分享微信朋友圈
- 编译命令行终端 swift
- curl 命令
- 系统休眠文件可以删除吗 系统休眠文件怎么删除
- AcWing 904. 虫洞 题解(spfa求负环)
- Receive user input, height BMI, BMI detection small business entry case
- MySQL script batch queries all tables containing specified field types in the database
- 云呐|工单管理软件,工单管理软件APP
- uva 1401 dp+Trie
- 公钥\私人 ssh避password登陆
猜你喜欢
随机推荐
What does security capability mean? What are the protection capabilities of different levels of ISO?
对C语言数组的再认识
AcWing 345. 牛站 题解(floyd的性质、倍增)
shell脚本快速统计项目代码行数
Neon Optimization: performance optimization FAQ QA
ClickHouse字段分组聚合、按照任意时间段粒度查询SQL
Can the system hibernation file be deleted? How to delete the system hibernation file
移植DAC芯片MCP4725驱动到NUC980
454-百度面经1
Telnet,SSH1,SSH2,Telnet/SSL,Rlogin,Serial,TAPI,RAW
如何管理分布式团队?
HMM 笔记
AcWing 1148. 秘密的牛奶运输 题解(最小生成树)
公钥\私人 ssh避password登陆
黑马笔记---创建不可变集合与Stream流
Start from the bottom structure to learn the customization and testing of fpga---- FIFO IP
7.6模拟赛总结
JTAG principle of arm bare board debugging
736. Lisp 语法解析 : DFS 模拟题
一起看看matlab工具箱内部是如何实现BP神经网络的









