linuxÃüÁîѧϰ±Ê¼Ç£¨10£©£ºcatÃüÁî
catÃüÁîµÄÓÃ;ÊÇÁ¬½ÓÎļþ»ò±ê×¼ÊäÈë²¢´òÓ¡¡£Õâ¸öÃüÁî³£ÓÃÀ´ÏÔʾÎļþÄÚÈÝ£¬»òÕß½«¼¸¸öÎļþÁ¬½ÓÆðÀ´ÏÔʾ£¬»òÕß´Ó±ê×¼ÊäÈë¶ÁÈ¡ÄÚÈݲ¢ÏÔʾ£¬Ëü³£ÓëÖض¨Ïò·ûºÅÅäºÏʹÓá£
1£®ÃüÁî¸ñʽ£º
cat [Ñ¡Ïî] [Îļþ]...
2£®ÃüÁÄÜ£º
catÖ÷ÒªÓÐÈý´ó¹¦ÄÜ£º
1.Ò»´ÎÏÔʾÕû¸öÎļþ:cat filename
2.´Ó¼üÅÌ´´½¨Ò»¸öÎļþ:cat > filename Ö»ÄÜ´´½¨ÐÂÎļþ,²»Äܱà¼ÒÑÓÐÎļþ.
3.½«¼¸¸öÎļþºÏ²¢ÎªÒ»¸öÎļþ:cat file1 file2 > file
3£®ÃüÁî²ÎÊý£º
-A, --show-all µÈ¼ÛÓÚ -vET
-b, --number-nonblank ¶Ô·Ç¿ÕÊä³öÐбàºÅ
-e µÈ¼ÛÓÚ -vE
-E, --show-ends ÔÚÿÐнáÊø´¦ÏÔʾ $
-n, --number ¶ÔÊä³öµÄËùÓÐÐбàºÅ,ÓÉ1¿ªÊ¼¶ÔËùÓÐÊä³öµÄÐÐÊý±àºÅ
-s, --squeeze-blank ÓÐÁ¬ÐøÁ½ÐÐÒÔÉϵĿհ×ÐУ¬¾Í´ú»»ÎªÒ»ÐеĿհ×ÐÐ
-t Óë -vT µÈ¼Û
-T, --show-tabs ½«Ìø¸ñ×Ö·ûÏÔʾΪ ^I
-u (±»ºöÂÔ)
-v, --show-nonprinting ʹÓà ^ ºÍ M- ÒýÓ㬳ýÁË LFD ºÍ TAB Ö®Íâ
4£®Ê¹ÓÃʵÀý£º
ʵÀýÒ»£º°Ñ log2012.log µÄÎļþÄÚÈݼÓÉÏÐкźóÊäÈë log2013.log Õâ¸öÎļþÀï
ÃüÁcat -n log2012.log log2013.log
Êä³ö£º
[root@localhost test]# cat log2012.log 2012-01 2012-02 ======[root@localhost test]# cat log2013.log 2013-01 2016-02 2016-03 ======[root@localhost test]# cat -n log2016.log log2016.log 1 2016-01 2 2016-02 3 4 5 ====== 6 2016-01 7 2016-02 8 9 10 2016-03 11 ======[root@localhost test]#
ʵÀý¶þ£º°Ñ log2012.log ºÍ log2013.log µÄÎļþÄÚÈݼÓÉÏÐкţ¨¿Õ°×Ðв»¼Ó£©Ö®ºó½«ÄÚÈݸ½¼Óµ½ log.log Àï¡£
ÃüÁcat -b log2012.log log2013.log log.log
Êä³ö£º
[root@localhost test]# cat -b log2015.log log2016.log log.log 1 2015-01 2 2015-02 3 ====== 4 2016-01 5 2016-02 6 2016-03 7 ======[root@localhost test]#
±¸×¢£ºtac (·´ÏòÁÐʾ)
ÃüÁtac log.txt
Êä³ö£º
[root@localhost test]# tac log.txt PWD=/opt/soft/test Linux World Hello
˵Ã÷£º
tac Êǽ« cat ·´Ð´¹ýÀ´£¬ËùÒÔËûµÄ¹¦Äܾ͸ú cat Ïà·´£¬ cat ÊÇÓɵÚÒ»Ðе½×îºóÒ»ÐÐÁ¬ÐøÏÔʾÔÚÓ©Ä»ÉÏ£¬¶ø tac ÔòÊÇÓÉ×îºóÒ»Ðе½µÚÒ»Ðз´ÏòÔÚÓ©Ä»ÉÏÏÔʾ³öÀ´£¡
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ