当前位置:网站首页>使用ps | egrep时过滤排除掉egrep自身
使用ps | egrep时过滤排除掉egrep自身
2022-07-31 05:11:00 【tcliuwenwen】
博文背景
[email protected]:/usr/local/redis-7.0.3# ps -ef | egrep redis
root 1815199 1 0 00:00 ? 00:01:28 ./src/redis-server 127.0.0.1:6379
root 1997222 1996120 0 19:23 pts/2 00:00:00 grep -E --color=auto redis
这个很丑陋,看着不习惯
[email protected]:/usr/local/redis-7.0.3# ps -ef | egrep redis | egrep -v grep
root 1815199 1 0 00:00 ? 00:01:28 ./src/redis-server 127.0.0.1:6379
这个很麻烦,看着不习惯
解决办法
% 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:6379
原理自己领悟,想想就很容易懂了。
边栏推荐
- [Cloud native] Ribbon is no longer used at the bottom layer of OpenFeign starting from the 2020.0.X version
- 【swagger关闭】生产环境关闭swagger方法
- Eternal blue bug reappears
- Take you to understand the MySQL isolation level, what happens when two transactions operate on the same row of data at the same time?
- gin框架学习-Gin框架和Gorm框架搭建一个简单的API微服务
- vulhub靶场学习日记hackme2
- Redis:安装使用
- Judgment of database in SQL injection
- 为什么redis是单线程还那么快?
- [Elastic-Job] Overview of Distributed Scheduling Tasks
猜你喜欢
随机推荐
Linux中mysql密码修改方法(亲测可用)
变量的解构赋值
[Cloud Native] What should I do if SQL (and stored procedures) run too slowly?
npm WARN config global `--global`, `--local` are deprecated. Use `--location解决方案
The latest MySql installation teaching, very detailed
【云原生】开源数据分析 SPL 轻松应对 T+0
2021年京东数据分析工程师秋招笔试编程题
带你搞懂MySQL隔离级别,两个事务同时操作同一行数据会怎样?
Linux modify MySQL database password
sqlmap注入教程 常用指令
Error: Cannot find module 'D:\Application\nodejs\node_modules\npm\bin\npm-cli.js'
C语言 | 获取字符串里逗号间隔的内容
GUCCI、LV等奢侈品巨头如何布局元宇宙的,其他品牌应该跟上吗?
leetcode-829. 连续整数求和(数论)
【ubuntu20.04安装MySQL以及MySQL-workbench可视化工具】
What is GameFi?
Getting to know regular expressions
Eternal blue bug reappears
Build DVWA with phpstudy
Object,多态 1(第八天)









