In some cases, you may just want to view a file without editing it. While you can still use text editors like nano or vi to view files, there are much faster ways to view a file in Linux.
The cat command
The cat command is one of the most popular and frequently used commands in Linux. The cat (short for concatenate) command concatenates and prints files to the standard output (terminal).
To view the facts.txt file that we created, you can run the cat facts.txt command:
elliot@ubuntu-linux:~$ cat facts.txt
Apples are red.
Grapes are green.
Bananas are yellow.
Cherries are red.
Sky is high.
Earth is round.
Linux is awesome!
Cherries are red.
Cherries are red.
Cherries are red.
You can now view the contents of the file facts.txt from the comfort of your terminal without having to open any text editor.
The cat command can do more than just viewing a file. It can also concatenate (put together) files. To demonstrate, create the following three files with your favorite text editor...