当前位置:网站首页>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支持的正则表达式写法,这里不再赘述。(因为实在太罕见了)
边栏推荐
- JTAG principle of arm bare board debugging
- Neon Optimization: an instruction optimization case of matrix transpose
- docker 方法安装mysql
- What does security capability mean? What are the protection capabilities of different levels of ISO?
- Set up [redis in centos7.x]
- How to prevent overfitting in cross validation
- Installation of gazebo & connection with ROS
- 子网划分、构造超网 典型题
- Yunna - work order management system and process, work order management specification
- Instructions for using the domain analysis tool bloodhound
猜你喜欢
Gin 入门实战
Instructions for using the domain analysis tool bloodhound
Dark horse notes - create immutable sets and streams
从底层结构开始学习FPGA----FIFO IP的定制与测试
Comparison of picture beds of free white whoring
The MySQL database in Alibaba cloud was attacked, and finally the data was found
今日问题-2022/7/4 lambda体中修改String引用类型变量
Make Jar, Not War
C language - array
Make Jar, Not War
随机推荐
go-zero微服务实战系列(九、极致优化秒杀性能)
Amway wave C2 tools
Body mass index program, entry to write dead applet project
一起看看matlab工具箱内部是如何实现BP神经网络的
Realize incremental data synchronization between MySQL and ES
Typical problems of subnet division and super network construction
Supersocket 1.6 creates a simple socket server with message length in the header
C语言实例_2
golang 基础 —— 数据类型
Failed to successfully launch or connect to a child MSBuild. exe process. Verify that the MSBuild. exe
c语言—数组
云呐-工单管理制度及流程,工单管理规范
Let's see how to realize BP neural network in Matlab toolbox
Taro2.* 小程序配置分享微信朋友圈
AcWing 361. 观光奶牛 题解(spfa求正环)
AcWing 1142. 繁忙的都市 题解(最小生成树)
Lldp compatible CDP function configuration
Taro2.* applet configuration sharing wechat circle of friends
Neon Optimization: performance optimization FAQ QA
405 method not allowed appears when the third party jumps to the website