#展示匹配次数
~ grep -c -i 'manpath' /etc/man.conf
24#以自动颜色不区分大小写显示行号
~ grep -n -i --color=auto 'manpath' /etc/man.conf
10:# This file is read by man to configure the default manpath (also used
11:# when MANPATH contains an empty substring), to find out where the cat
13:# and to map each PATH element to a manpath element.
18:# MANPATH manpath_element [corresponding_catdir]
19:# MANPATH_MAP path_element manpath_element
41:# Every automatically generated MANPATH includes these fields
43:MANPATH /usr/share/man
50:# MANPATH /usr/lib/*/man
51:# MANPATH /usr/share/*/man
52:# MANPATH /usr/kerberos/man
#展示符合条件的第一列
~ last | grep -n 'root'| cut -d ' ' -f1
24:root
41:root
#反向展示符合条件的第一列
~ last | grep -v -n 'root'| cut -d ' ' -f1
1:yichaosong
2:yichaosong
3:yichaosong
4:yichaosong
5:yichaosong