Viewing the Contents of a File
You want to view the contents of a small file without editing it.
Use the cat or more commands to view the file.
For example:
$ more myfile.txt This file contains some text |
Discussion
The cat command displays the whole contents of the file, even if it is longer than will fit on the screen.
The more command just displays one screen of text at a time. Press the space bar to display the next screen.
See Also
You can also use cat to concatenate (join together) a number of files (Recipe 3.28).
Another popular command related to more is less. less is like more except it allows you to move backward in the file as well as forward.