Linux cat command usage

Source: Internet
Author: User


Linux cat command usage Linux Cat command has three main functions: www.2cto.com 1. Linux Cat command displays the entire file at a time. $ Cat filename2.Linux Cat command creates a file from the keyboard. $ Cat> filename (only new files can be created, and existing files cannot be edited) 3. the Linux Cat command combines several files into one file. $ Cat file1 file2> file
Parameter:-n or -- number indicates the number of all output rows starting from 1-B or -- number-nonblank is similar to-n, however, if a blank row is not numbered-s or -- squeeze-blank and there are two or more consecutive blank rows, it is replaced by a blank row-v or -- show-nonprinting example: cat-n textfile1> textfile2 Add the textfile1 file content to the row number and enter textfile2 in the file cat-B textfile1 textfile2> textfile3 Add the textfile1 and textfile2 file content to the row number (no blank lines) add) then, append the content to textfile3.
Example: cat-n textfile1> textfile2 Add the textfile1 file content to the row number and enter textfile2 in the file cat-B textfile1 textfile2> textfile3 Add the textfile1 and textfile2 file content to the row number (no blank lines) add) then, append the content to textfile3. Cat/dev/null>/etc/test.txt this indicates clearing the/etc/test.txt file content. cat can also be used to create an image file. Cat/dev/fd0> OUTFILE: for example, to create an image file for a soft disk, put the soft disk and press cat IMG_FILE>/dev/fd0. If you want to write the image file to the soft disk, press
Note: 1. OUTFILE indicates the output image file name. 2. IMG_FILE refers to image file. 3. If the device is written back from the image file, the device capacity must be equal to that of the device. 4. It is usually used to make boot CIDS.

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.