![ps aux | configuração grep vs ps aux | grep "confi[g]"](https://rvso.com/image/95511/ps%20aux%20%7C%20configura%C3%A7%C3%A3o%20grep%20vs%20ps%20aux%20%7C%20grep%20%22confi%5Bg%5D%22%20.png)
Gostaria de saber por que ps aux | grep
inclui o grep
comando na saída, mas ps aux | grep "confi[g]"
não inclui.
$ ps aux | grep config
root 50 0.0 0.0 2548368 5760 ?? Ss 14Sep16 0:29.27 /usr/libexec/configd
emesa 20534 0.0 0.0 2434840 796 s002 S+ 4:41PM 0:00.00 grep config
vs.
$ ps aux | grep "confi[g]"
root 15776 0.0 0.0 2519824 940 ?? Ss Tue11AM 0:00.08 /System/Library/PrivateFrameworks/SystemAdministration.framework/XPCServices/writeconfig.xpc/Contents/MacOS/writeconfig
root 50 0.0 0.0 2547320 5740 ?? Ss 14Sep16 0:29.27 /usr/libexec/configd
Responder1
Como grep "confi[g]"
o comando procura o"configuração"string e no seu segundo caso o grep "confi[g]"
comando não contém o"configuração"corda. Ele contém o"confi[g]"corda.
É um truque grep comumente usado para evitar a impressão do processo do comando grep ao pesquisar na ps
saída.