# cat -n /etc/ntp.conf
1 # Permit time synchronization our time resource but do not
2 # permit the source to query or modify the service on this system
3 restrict default kod nomodify notrap nopeer noquery
4 restrict -6 default kod nomodify notrap nopeer noquery
5
6 # Permit all access over the loopback interface. This could be
7 # tightened as well, but to do so would effect some of the
8 # administration functions
9 restrict 127.0.0.1
10 restrict -6 ::1
3. 在非空格行首顯示行號
類似于-n參數(shù),-b也可以顯示行號。區(qū)別在于-b只在非空行前顯示行號。
#cat -b /etc/ntp.conf
1 # Permit time synchronization our time resource but do not
2 # permit the source to query or modify the service on this system
3 restrict default kod nomodify notrap nopeer noquery
4 restrict -6 default kod nomodify notrap nopeer noquery
5 # Permit all access over the loopback interface. This could be
6 # tightened as well, but to do so would effect some of the
7 # administration functions
8 restrict 127.0.0.1
9 restrict -6 ::1
# cat -T /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1^I^Ilocalhost.localdomain localhost
::1^I^Ilocalhost6.localdomain6 localhost6
5. 顯示換行符
-E參數(shù)在每行結(jié)尾使用 $ 表示換行符。如下所示 :
# cat -E /etc/hosts
# Do not remove the following line, or various programs$
# that require network functionality will fail.$
127.0.0.1 localhost.localdomain localhost$
::1 localhost6.localdomain6 localhost6$
6. 同時顯示制表符及換行符
當你想要同時達到-T及-E的效果, 可使用-A參數(shù).
# cat -A /etc/hosts
# Do not remove the following line, or various programs$
# that require network functionality will fail.$
127.0.0.1^I^Ilocalhost.localdomain localhost$
::1^I^Ilocalhost6.localdomain6 localhost6$