命令名:cat
功能:在当前窗口中查看制定位置的文件的内容。
eg:
renjg@renjg-HP-Compaq-Pro-6380-MT:~/test$ cat /etc/apache2/ports.conf # If you just change the port or add more ports here, you will likely also # have to change the VirtualHost statement in # /etc/apache2/sites-enabled/000-default.conf Listen 80 Listen xxxx Listen xxxx <IfModule ssl_module> Listen 443 </IfModule> <IfModule mod_gnutls.c> Listen 443 </IfModule> # vim: syntax=apache ts=4 sw=4 sts=4 sr noet renjg@renjg-HP-Compaq-Pro-6380-MT:~/test$
常见用法:将输出的内容显示行号
renjg@renjg-HP-Compaq-Pro-6380-MT:~/test$ cat -n /etc/apache2/ports.conf 1 # If you just change the port or add more ports here, you will likely also 2 # have to change the VirtualHost statement in 3 # /etc/apache2/sites-enabled/000-default.conf 4 5 Listen 80 6 Listen xxxx 7 Listen xxxx 8 <IfModule ssl_module> 9 Listen 443 10 </IfModule> 11 12 <IfModule mod_gnutls.c> 13 Listen 443 14 </IfModule> 15 16 # vim: syntax=apache ts=4 sw=4 sts=4 sr noet renjg@renjg-HP-Compaq-Pro-6380-MT:~/test$