About Cat> file, cat

Source: Internet
Author: User

1. Cat> the file records the keyboard input, which is equivalent to creating a file from the keyboard, and only creating a new file and not editing an existing file.>It is data-oriented and will output the text you entered to the file.

2. Cat <EOF

CatCommandYesLinuxThe following text output command is usually used to viewFileContent;
EOF is "End of file", indicating the text Terminator. By combining these two identifiers, you can avoid using multi-line echo commands and achieve multi-line output results.

[Example] ##------> use Cat> file <EOF to output multiline files

/Bin/mkdir-P/usr/local/Nagios/etc

Cat>/usr/local/Nagios/etc/nrpe. cfg <EOF
Log_facility = daemon
Pid_file =/var/run/nrpe. PID
Server_port = 5666
Nrpe_user = Nagios
Nrpe_group = Nagios
Allowed_hosts = 127.0.0.1, nagios.xcar.com.cn, mon.xcar.com.cn
Dont_blame_nrpe = 0
DEBUG = 0
Command_timeout = 60
Connection_timeout = 300
Command [check_load] =/usr/local/Nagios/libexec/check_load-W 15,10, 5-C 30,25, 20
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.