当前位置:网站首页>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支持的正则表达式写法,这里不再赘述。(因为实在太罕见了)
边栏推荐
- Spark TPCDS Data Gen
- [advanced C language] 8 written questions of pointer
- 系统休眠文件可以删除吗 系统休眠文件怎么删除
- 各种语言,软件,系统的国内镜像,收藏这一个仓库就够了: Thanks-Mirror
- [signal and system]
- [JS] obtain the N days before and after the current time or the n months before and after the current time (hour, minute, second, year, month, day)
- AcWing 361. 观光奶牛 题解(spfa求正环)
- THREE. AxesHelper is not a constructor
- According to the analysis of the Internet industry in 2022, how to choose a suitable position?
- Neon Optimization: performance optimization FAQ QA
猜你喜欢

系统休眠文件可以删除吗 系统休眠文件怎么删除

AcWing 1148. 秘密的牛奶运输 题解(最小生成树)

C language - array

AcWing 361. 观光奶牛 题解(spfa求正环)

Yunna - work order management system and process, work order management specification

HMM 笔记
![[advanced C language] 8 written questions of pointer](/img/d4/c9bb2c8c9fd8f54a36e463e3eb2fe0.png)
[advanced C language] 8 written questions of pointer

设置Wordpress伪静态连接(无宝塔)

2022 Google CTF SEGFAULT LABYRINTH wp

Asset security issues or constraints on the development of the encryption industry, risk control + compliance has become the key to breaking the platform
随机推荐
AcWing 345. 牛站 题解(floyd的性质、倍增)
Neon Optimization: an optimization case of log10 function
Can the system hibernation file be deleted? How to delete the system hibernation file
Yunna - work order management system and process, work order management specification
DS-5/RVDS4.0变量初始化错误
Table table setting fillet
Machine learning: the difference between random gradient descent (SGD) and gradient descent (GD) and code implementation.
[case sharing] basic function configuration of network loop detection
C language instance_ four
Spark TPCDS Data Gen
How to manage distributed teams?
JTAG debugging experience of arm bare board debugging
AcWing 1148. 秘密的牛奶运输 题解(最小生成树)
2022 Google CTF SEGFAULT LABYRINTH wp
2022 Google CTF segfault Labyrinth WP
Transformation transformation operator
Telnet,SSH1,SSH2,Telnet/SSL,Rlogin,Serial,TAPI,RAW
Installation and testing of pyflink
C # method of calculating lunar calendar date 2022
LeetCode. 剑指offer 62. 圆圈中最后剩下的数