1
我正在解析ps -ef | grep進程中的一些信息,但它總是在grep的輸出中顯示grep本身的最後一行。 如何在沒有最後一行的情況下獲得grep的輸出? 輸出看起來像這樣:BASH:如何避免在grep中顯示最後一行?
[email protected]:~# ps -ef |grep gnome-terminal
itaig 3307 2306 0 09:37 ? 00:00:00 /bin/sh -c gnome-terminal
itaig 3308 3307 0 09:37 ? 00:01:58 gnome-terminal
root 7055 5047 0 13:37 pts/10 00:00:00 grep --color=auto gnome-terminal
[email protected]:~#
爲什麼我沒有考慮它? grep -v grep就足夠了!謝謝 –