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