cat Command - Output the Contents of the Files

You can use the cat command to output the contents of the file.

# Output the contents of the file
cat foo.txt

The output result is as follows.

Hello
World!

cat is derived from concat. concat means to connect.

In fact, if you pass multiple files to the cat command, the contents of multiple files will be connected and output. This is the origin of the name.

# Output by connecting the contents of multiple files
cat foo.txt bar.txt

Associated Information