1。一般的查詢,grep root /etc/passwd
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
2。加個顏色吧,grep –color=auto root /etc/passwd 或 grep –color=always root /etc/passwd
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
3。你也可以把它放在 ~/.bashrc
alias grep=’grep –colour=always’
之後這麼查 grep root /etc/passwd 就可以了
留言