1 # Permit time synchronization our time resource but donot 2 # permit the source to query or modify the service on this system 3restrictdefault kod nomodify notrap nopeer noquery 4restrict-6default kod nomodify notrap nopeer noquery 5 6 # Permit allaccessover the loopback interface. This could be 7 # tightened as well, but todo so would effect someof the 8 # administration functions 9restrict127.0.0.1 10restrict-6 ::1
3. 在非空格行首显示行号
类似于-n参数,-b也可以显示行号。区别在于-b只在非空行前显示行号。
1 2 3 4 5 6 7 8 9 10 11 12 13
#cat -b /etc/ntp.conf
1 # Permit time synchronization our time resource but donot 2 # permit the source to query or modify the service on this system 3restrictdefault kod nomodify notrap nopeer noquery 4restrict-6default kod nomodify notrap nopeer noquery
5 # Permit allaccessover the loopback interface. This could be 6 # tightened as well, but todo so would effect someof the 7 # administration functions 8restrict127.0.0.1 9restrict-6 ::1
4. 显示tab制表符
当你想要显示文本中的tab制表位时. 可使用-T参数. 它会在输入结果中标识为 ^I .
1 2 3 4 5 6 7
# 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参数在每行结尾使用 $ 表示换行符。如下所示 :
1 2 3 4 5 6 7
# 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参数.
1 2 3 4 5 6 7
# 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$