2023年8月3日星期四

linux cat create a txt file by EOF

EOF is a token that tells the cat command to terminate when it sees such a token in the subsequent lines.

cat > readme.txt << EOF

This is an input stream literal EOF


Followed by CTRL+D to terminate the command:

cat > readme.txt This is a readme file. This is a new line.

 

Append to an existing file, we can use the “>>” operator:

cat >> readme.txt
This is an appended line.

没有评论: