Cat >file << EOF

Source: Internet
Author: User

1, cat >file record is keyboard input, equivalent to create a file from the keyboard, and can only create new files, cannot edit existing files. > is a data redirection that outputs the text content you enter into file.

2. Cat <<eof

The cat command is a text output command under Linux, usually for viewing the contents of a file;
EOF is "End of File", which represents the text terminator.

Combining these two identities avoids the use of multi-line echo commands and results in multiple lines of output.

"Example" # #------> Use cat > File <<eof to implement output from multiple lines of files

Cat > Ip.txt << EOF
124
42131341
7879879879
32114
Eof

3. Cat > Ip.txt

Abcd
Dcba
Eftf
Ctrl-d



Cat >file << EOF

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.