One linux Command every day (10): cat command link: One linux Command every day (1): ls command http://www.bkjia.com/ OS /201210/163049.html#linuxlinuxcommand every day (2): cd command serial (3 ): pwd command Export (4): mkdir command Export (5): rm command http://www.bkjia.com/ OS /201210/161092.html#linuxcommand (6) every day: rmdir command http://www.bkjia.com/ OS /201210/164017. Html; a linux Command (7) every day: mv command http://www.bkjia.com/ OS /201210/1620.7.html#a linuxcommand every day (8): cp command serial (9): touch command http://www.bkjia.com/ OS /201211/165699.html cat command is used to connect files or standard input and print. This command is often used to display the file content, connect several files, or read and display the content from the standard input. It is often used with the redirection symbol. 1. command Format: www.2cto.com cat [Option] [file]... 2. command function: cat has three main functions: 1. display the entire file at a time: cat filename2. create a file from the keyboard: cat> filename can only create a new file, not edit an existing file. 3. combine several files into one file: cat file1 file2> file3. command parameter:-A, -- show-all is equivalent to-vET-B, -- number-nonblank: numbers of non-Null Output rows-e is equivalent to-vE-E. -- show-ends displays $-n at the end of each row, -- number indicates the number of all rows in the output, starting from 1 to the number of rows in the output-s, -- squeeze-blank has a blank row with more than two rows in a row, replace the blank line-t with-vT equivalent-T, -- show-tabs will show the grid character as ^ I-u (ignored)-v, -- show-nonprint Ing uses ^ and M-references, except LFD and TAB. instance: instance 1: add the line number to the log2012.log file and enter the command: cat-n log2012.log log2013.log output: [root @ localhost test] # cat log2012.log 2012-012012-02 ===== [root @ localhost test] # cat log2013.log 2013-012013-022013-03 ==== = [root @ localhost test] # cat-n log2012.log log2013.log 1 2012-01 2 2012-02 3 4 5 = 6 2013-01 7 2013-02 8 9 10 2013-03 11 ===== [root @ localhost test] # Note: instance 2: add the file content of log2012.log and log2013.log to the line number (blank rows are not added) and then append the content to log. log. Command: cat-B log2012.log log2013.log. log output: [root @ localhost test] # cat-B log2012.log log2013.log log. log 1 2012-01 2 2012-02 3 ===== 4 2013-01 5 2013-02 6 2013-03 7 ===== [root @ localhost test] # Example 3: add the row number to the file content of log2012.log and enter log. log File command: Output: [root @ localhost test] # cat log. log [root @ localhost test] # cat-n log2012.log> log. log [root @ localhost test] # cat-n log. log 1 2012-01 2 2012-02 3 4 5 ==== = [Root @ localhost test] # Example 4: Use the here doc to generate the file output: [root @ localhost test] # cat> log.txt <EOF> Hello> World> Linux> PWD =$ (pwd)> EOF [root @ localhost test] # ls-l log.txt-rw-r -- 1 root 37 10-28 log.txt [root @ localhost test] # cat log.txt HelloWorldLinuxPWD =/ opt/soft/test [root @ localhost test] # description: note the bold part. here doc can replace strings. Note: tac (reverse list) command: tac log.txt output: [root @ localhost test] # tac log.txt PWD =/opt/soft/testLinuxWorldHello Description: tac reversed cat, so its function is opposite to cat. cat is displayed consecutively from the first row to the last row on the screen, while tac is displayed on the screen from the last row to the first row!