当前位置:网站首页>Filter out egrep itself when using ps | egrep
Filter out egrep itself when using ps | egrep
2022-07-31 05:58:00 【tcliuwenwen】
Blog Background
[email protected]:/usr/local/redis-7.0.3# ps -ef | egrep redisroot 1815199 1 0 00:00 ? 00:01:28 ./src/redis-server 127.0.0.1:6379root 1997222 1996120 0 19:23 pts/2 00:00:00 grep -E --color=auto redisThis is ugly, I'm not used to it
[email protected]:/usr/local/redis-7.0.3# ps -ef | egrep redis | egrep -v greproot 1815199 1 0 00:00 ? 00:01:28 ./src/redis-server 127.0.0.1:6379This is very troublesome, I'm not used to it
Solution
% ps -ef | egrep "[r]edis"[email protected]:/usr/local/redis-7.0.3# ps -ef | egrep "[r]edis"root 1815199 1 0 00:00 ? 00:01:28 ./src/redis-server 127.0.0.1:6379The principle is understood by oneself, and it is easy to understand when you think about it.
Reference link: https://www.baeldung.com/linux/grep-exclude-ps-results#2-make-a-grep-expression-that-excludes-grep-itself
边栏推荐
- flutter arr 依赖
- 利用phpstudy搭建DVWA
- quick-3.5 无法使用模拟器修改
- C language tutorial (1) - preparation
- 2021面经-拥抱变化
- [Ubuntu20.04 installs MySQL and MySQL-workbench visualization tool]
- 自定dialog 布局没有居中解决方案
- Take you to understand the MySQL isolation level, what happens when two transactions operate on the same row of data at the same time?
- 动态规划(一)| 斐波那契数列和归递
- DeFi 项目中的治理Token
猜你喜欢

What is GameFi?

npm WARN config global `--global`, `--local` are deprecated. Use `--location解决方案

局部变量成员变量、引用类型、this,static(第五天)

Common JVM interview questions and answers

GUCCI, LV and other luxury giant universe how to layout yuan, other brands should keep up with?

win11中利用IIS10搭建asp网站

The MySQL database in Alibaba Cloud was attacked, and the data was finally recovered

年终总结——岁月静好~

【云原生】微服务Nacos的简单介绍与使用

DeFi Token in the project management
随机推荐
DeFi Token in the project management
局部变量成员变量、引用类型、this,static(第五天)
js中的函数
理解js运算符
阿里一面,说说你知道消息中间件的应用场景有哪些?
(Crypto必备干货)详细分析目前NFT的几大交易市场
quick-3.5 无法正常显示有混合纹理的csb文件
npm WARN config global `--global`, `--local` are deprecated. Use `--location solution
What is GameFi?
MySql to create data tables
flutter arr 依赖
MySQL高级语句(一)
对于输出点是时间戳的渗透测试方法(以Oracle数据库为例)
著名网站msdn.itellyou.cn原理分析
【云原生】SQL(及存储过程)跑得太慢怎么办?
Why is the redis single-threaded also so fast?
For penetration testing methods where the output point is a timestamp (take Oracle database as an example)
The feign call fails, JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r
一个简单的bash转powershell案例
On the side of Ali, tell me what are the application scenarios of message middleware you know?