![ps auxiliar | configuración grep frente a ps aux | grep "confi[g]"](https://rvso.com/image/95511/ps%20auxiliar%20%7C%20configuraci%C3%B3n%20grep%20frente%20a%20ps%20aux%20%7C%20grep%20%22confi%5Bg%5D%22%20.png)
Me gustaría saber por qué ps aux | grep
incluye el grep
comando en el resultado pero ps aux | grep "confi[g]"
no lo incluye.
$ 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
Respuesta1
Porque grep "confi[g]"
el comando busca el"configuración"cadena y en su segundo caso el grep "confi[g]"
comando no contiene el"configuración"cadena. Contiene el"confi[g]"cadena.
Es un truco grep de uso común para evitar imprimir el proceso del comando grep cuando se busca en ps
la salida.