当前位置:网站首页>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
边栏推荐
- cocoscreator3.5.2打包微信小游戏发布到QQ小游戏修改
- Understanding SSRF, this article is enough
- npm WARN config global `--global`, `--local` are deprecated. Use `--location解决方案
- [Elastic-Job source code analysis] - job listener
- 阿里一面,说说你知道消息中间件的应用场景有哪些?
- 腾讯云GPU桌面服务器驱动安装
- 场效应管 | N-mos内部结构详解
- sqlmap注入教程 常用指令
- What is an EVM Compatible Chain?
- [swagger close] The production environment closes the swagger method
猜你喜欢

mac10.14中安装mysqldb

The latest MySql installation teaching, very detailed

The server time zone value ‘й‘ is unrecognized or represents more than one time zone

Sqlite A列数据复制到B列

MySQL高级学习笔记

【JVM加载】---类加载机制

flutter 混合开发 module 依赖

阿里一面,说说你知道消息中间件的应用场景有哪些?

【云原生】微服务Nacos的简单介绍与使用
![[Elastic-Job source code analysis] - job listener](/img/99/5e047b1aa83aad7d7f17b4eec606e6.png)
[Elastic-Job source code analysis] - job listener
随机推荐
对js的数组的理解
2021面经-拥抱变化
win11中利用IIS10搭建asp网站
The feign call fails, JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r
quick lua加密
sql 外键约束【表关系绑定】
2021年京东数据分析工程师秋招笔试编程题
MySQL分页查询的5种方法
sqlite 查看表结构 android.database.sqlite.SQLiteException: table splitTable has no column named
[windows]--- SQL Server 2008 super detailed installation tutorial
Build vulhub vulnerability shooting range on kali
NFT与数字藏品到底有何区别?
一个简单的bash转powershell案例
Build DVWA with phpstudy
Access database query
The MySQL database in Alibaba Cloud was attacked, and the data was finally recovered
C language tutorial (1) - preparation
【windows】--- SQL Server 2008 超详细安装教程
MySQL compressed package installation, fool teaching
小米手机短信定位服务激活失败