当前位置:网站首页>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
边栏推荐
- 代码执行漏洞
- Detailed explanation of pointers in C language
- Error: Cannot find module 'D:\Application\nodejs\node_modules\npm\bin\npm-cli.js'
- [Cloud native] Open source data analysis SPL easily copes with T+0
- For penetration testing methods where the output point is a timestamp (take Oracle database as an example)
- [swagger close] The production environment closes the swagger method
- Using IIS10 to build an asp website in win11
- 安装Multisim出现 No software will be installed or removed解决方法
- 腾讯云轻量服务器删除所有防火墙规则
- 腾讯云GPU桌面服务器驱动安装
猜你喜欢
随机推荐
quick-3.6源码修改纪录
【uiautomation】微信好友列表获取(存储到txt中)
了解SSRF,这一篇就足够了
2021 Mianjing - Embrace Change
阿里一面,说说你知道消息中间件的应用场景有哪些?
Oracle数据库中的“limit”查询
自定dialog 布局没有居中解决方案
常见JVM面试题及答案整理
js中的全局作用域与函数作用域
Markdown 帮助文档
Install mysqldb in mac10.14
What is the difference between NFT and digital collection?
cocos2d-x 实现跨平台的目录遍历
Attribute Changer的几种形态
configure:error no SDL library found
计网 Packet Tracer仿真 | 简单易懂集线器和交换机对比(理论+仿真)
GUCCI、LV等奢侈品巨头如何布局元宇宙的,其他品牌应该跟上吗?
安装Multisim出现 No software will be installed or removed解决方法
C language tutorial (2) - printf and data types that come with c
碎片化NFT(Fractional NFT)
![[Cloud Native] What should I do if SQL (and stored procedures) run too slowly?](/img/40/be3a30743ee2bc6c82f82ab852f29c.png)








