cat – concatenate files and print on the standard output
cat [OPTION]… [FILE]…
Here Document: the here document syntax can be used with the cat command:
cat > readme.txt << EOF This is an input stream literal EOF
where EOF is a token that tells the cat command to terminate when it sees such a token in the subsequent lines.
The token can be any other value as long as it is distinct enough that it won’t appear in the input stream literal. Note that both of the starting and ending EOF tokens will not show up in the readme.txt file.
Display a file:
Display all .txt files:
Concatenate (combine) two files:
cat File1.txt File2.txt > union.txt
If you need to combine two files but also eliminate duplicates (deduplication), this can be done with sort unique:
sort -u File1.txt File2.txt > unique_union.txt
Put the contents of a file into a variable