Example of cat commands in linux

Source: Internet
Author: User

The cat command function example in linux has three main functions: 1. display the entire file at a time. $ Cat filename 2. 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 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 linuxfile1> linuxfile2 Add the file content of linuxfile1 to the row number and enter cat-B linuxfile1 linuxfile2> linuxfile3 put linuxfile1 and li Add the row number to the file content of nuxfile2 (left blank) and then append the content to linuxfile3. Cat/dev/null>/etc/test.txt this indicates clearing the/etc/test.txt File Content

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.