How to use cat commands in linux

Source: Internet
Author: User
In linux, the cat command is commonly used in linux. cat has three main functions: www.2cto. com1. the entire file is displayed at a time. $ Catfilename2. create a file from the keyboard. $ Cat & gt; filename can only create new files...
In linux, cat commands are commonly used in linux. cat has three main functions: www.2cto.com 1. display the entire file at a time. $ Cat filename2. create a file from the keyboard. $ Cat> filename can only create new files and cannot edit existing files. 3. combine several files into one file. $ Cat file1 file2> the specific command format of file cat is: cat [-AbeEnstTuv] [-- help] [-- version] fileName description: connect the file string to the basic output (screen or add> fileName to another file) parameter: -n or-number starts from 1 and is similar to-n for the number of all output rows-B or-number-nonblank, however, if the blank row is not numbered-s or-squeeze-blank, when there is a blank row with more than two consecutive rows, for example: cat-n linuxfile1> linuxfile2 add the file content of linuxfile1 to the row number and enter cat-B linuxfile1 linuxfile2> linuxfile3 put li Add the row number to the file content of nuxfile1 and linuxfile2 (the blank row is not added) and then append the content to linuxfile3. Example: add the row number to the file content of linuxfile1 and enter cat-n linuxfile1> linuxfile2 to add the row number to the file content of linuxfile1 and linuxfile2) then, append the content to linuxfile3. Cat-B linuxfile1 linuxfile2> linuxfile3cat/dev/null>/etc/test.txt this is to clear the/etc/test.txt file content this article is from the time drift bottle
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.