Linuxcat command details

Source: Internet
Author: User
The linuxcat command is explained in detail. before explaining this command, let's take a look at the two instances of this command. through the example, let's look at the detailed parameters of cat. This command is mainly used to add the content of the document, for example: add the row number to the file content of textfile1 and enter textfile2...

For details about the linux cat command, before explaining this command, let's take a look at the two instances of this command. through the example, let's look at the detailed cat parameters. This command is mainly used to add the content of this document,
Example:
Add the row number to the file content of textfile1 and enter textfile2.
Cat-n textfile1> textfile2
Add the row number to the file content of textfile1 and textfile2 (blank rows are not added) and then append the content to textfile3.
Cat-B textfile1 textfile2> 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. For example, if you want to create an image file for a soft disk, place the soft disk and press
Cat/dev/fd0> OUTFILE
If you want to write the image file to a soft disk
Cat IMG_FILE>/dev/fd0

Permission: all users
Usage: cat [-AbeEnstTuv] [-- help] [-- version] fileName
Note: connect the archive string and upload it to the basic output (screen or add> fileName to another Archive)
Parameters:
-N or -- number indicates the number of all output rows starting from 1.
-B or -- number-nonblank is similar to-n, but is not numbered for blank rows.
-S or -- squeeze-blank when there are two consecutive blank rows or more, it is replaced by a blank row
-V or -- show-nonprinting
General example:
Cat-n textfile1> textfile2: add the row number to the file content of textfile1 and enter textfile2.
Cat-B textfile1 textfile2> textfile3 adds the file content of textfile1 and textfile2 to the row number (blank rows are not added) and then attaches the content to textfile3.

Note:
1. OUTFILE indicates the name of the output image file.
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.



Author feihan21

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.