![追伸 | grep config と ps aux | grep "config[g]"](https://rvso.com/image/95511/%E8%BF%BD%E4%BC%B8%20%7C%20grep%20config%20%E3%81%A8%20ps%20aux%20%7C%20grep%20%22config%5Bg%5D%22%20.png)
出力にコマンドps aux | grep
が含まれているのに含まれない理由を知りたいです。grep
ps aux | grep "confi[g]"
$ 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
対
$ 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
答え1
grep "confi[g]"
コマンドは「設定」文字列と2番目のケースではgrep "confi[g]"
コマンドに「設定」文字列。「設定」弦。
ps
これは、出力で検索するときに grep コマンドのプロセスが印刷されないようにするためによく使用される grep トリックです。