| Previous | Table of Contents | Next |
RELATED COMMANDS
Refer to modules 24, 103, and 105 for descriptions of the cp, pg, and pr commands.
RELATED FILES
The cat command is a filter; therefore, it can read the standard input and write to the standard output.
APPLICATION
The cat command can be used to concatenate files together, display the contents of files, and copy files. The concatenation of files is joining one file to the end of another. Displaying files is sending the data to your terminal screen. Copying files is done in conjunction with the shell’s redirection capabilities.
Other commands have been designed to provide enhanced functions of cat. To display files use the pg (SV) or more (BSD) command. The cp command is designed specifically for copying files.
TYPICAL OPERATION
In this activity the cat command is used to display and create files using cat. Begin at the shell prompt.
cj> cat > file1
This text is being read by cat from my terminal keyboard.
Cat will read the text as it is typed and create file1.
With a blank third line!
^I ^L Just a few control keys for demonstration.
^D
cj> cat -vte file1
This text is being read by cat from my terminal keyboard.$
Cat will read the text as it is typed and create file1.$
$
With a blank third line!$
^I ^L Just a few control keys for demonstration.$
cj> cat file2
This text is being read by cat from my terminal keyboard.
Cat will read the text as it is typed and create file1.
With a blank third line!
Just a few control keys for demonstration.
=========
This text is being read by cat from my terminal keyboard.
Cat will read the text as it is typed and create file1.
With a blank third line!
Just a few control keys for demonstration.
cj> ls
bin calendar db file1 file2 letters myfile
| Previous | Table of Contents | Next |