当前位置:网站首页>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
边栏推荐
- [Ubuntu20.04 installs MySQL and MySQL-workbench visualization tool]
- npm WARN config global `--global`, `--local` are deprecated. Use `--location solution
- Sqlite A列数据复制到B列
- sql 外键约束【表关系绑定】
- cocos create EditBox 输入文字被刘海屏遮挡修改
- [swagger close] The production environment closes the swagger method
- sql 添加 default 约束
- C language tutorial (2) - printf and data types that come with c
- 【云原生】原来2020.0.X版本开始的OpenFeign底层不再使用Ribbon了
- 自定dialog 布局没有居中解决方案
猜你喜欢
随机推荐
DeFi 项目中的治理Token
[Elastic-Job] Overview of Distributed Scheduling Tasks
[JVM Loading]---Class Loading Mechanism
场效应管 | N-mos内部结构详解
sqlmap注入教程 常用指令
腾讯云GPU桌面服务器驱动安装
阿里一面,说说你知道消息中间件的应用场景有哪些?
代码执行漏洞
【JVM加载】---类加载机制
quick-3.5 无法使用模拟器修改
Using IIS10 to build an asp website in win11
阿里云中mysql数据库被攻击了,最终数据找回来了
Access数据库的查询
Build vulhub vulnerability shooting range on kali
纯shell实现文本替换
Linux中mysql密码修改方法(亲测可用)
2021面经-拥抱变化
flutter 混合开发 module 依赖
SQLite 查询表中每天插入的数量
MySQL-如何分库分表?一看就懂









