ps aux | grep redis
redis 1092 0.9 1.7 1638008 559216 ? Ssl Jul05 188:00 /usr/bin/redis-server 127.0.0.1:6379
root 3366704 0.0 0.0 112728 2308 pts/1 S+ 18:37 0:00 grep --color=auto redis
ps aux | grep [r]edis
redis 1092 0.9 1.7 1638008 559216 ? Ssl Jul05 188:00 /usr/bin/redis-server 127.0.0.1:6379
ps aux | grep [r]edis
进程中,grep
参数是--color=auto [r]edis
. 和grep的正则匹配不相符,因此不会输出到结果.