Concatenating Files

The command cat (concatenate) displays files to standard output. If you want to view the contents of a short text file, the easiest thing to do is to cat it, which sends its contents to the shell's standard output — the shell in which you typed the cat command. If you cat two files, you will see the contents of each flying past on the screen. But if you want to combine those two files into one, all you need to do is cat them and redirect the output of the cat command to a file using >. Some examples of the use of the cat command:

Was this article helpful?

0 0

Post a comment