The cat command

The cat command



What does it do ?

This program will display text files to the screen so that you may read them. It will also put several files into a another file that you specify with the redirection operator ">" .


How is it used ?

cat filename filename


Examples and remarks

Cat assumes you are referring to the screen when you use it. Therefore, if you want cat to put the information in a file you must use the redirection operator ">" Example to the screen: If you type in the command cat prog1.c , the contents of the file prog1.c will scroll across the screen. Example to a file: Also you can type cat file.1 file.2 > file.3 and a file called file.3 will be created. The first file to be stored in file.3 will be file.1 and then file.2 . However you may cat 30 ,50 or 100 files into one file if you like. Just type cat with all the files you would like cat to append into the file. Make sure that after you finish typing in all the file(s) you want appended, you use the redirection operator and then give it a file to append all the files into.



next previous table of contents