Combining Files

Learn how to combine files using the CLI and how to read large files using the more command.

Reading multiple files

The cat command is the go-to tool for looking at the contents of small files. If we send multiple files to the cat command, it’ll read them all in the specified order. Let’s try it. We first create two files in our current directory:

$ echo "Hello" > hello.txt

$ echo "Goodbye" > goodbye.txt

Now, let’s use the cat command to read both files:

$ cat hello.txt goodbye.txt

Run the commands on the terminal below.

Get hands-on with 1200+ tech skills courses.