next up previous contents
Next: Naming Files Up: Basic File Commands Previous: Basic File Commands

Displaying Contents of Text Files

The contents of a text file can be viewed one page at a time by using the more command:

more textfilename

A page will be displayed at your screen, and more will then pause with the message '-More-' followed by a percent sign and a number. The number represents the percentage of the file that you have already seen, i.e. '-More-(5%)' means that you have 95% more text to view. Commands can be entered while more is paused. Some of the commands to control more are as follows:

On Linux machines you may want to use the less command which supports moving backwards in a file. The commands are the same as for more. On the SGI's you may want to use the pg command which supports moving backward in a file:

Another way of displaying text files is with the cat command:

cat textfilename[textfilename..]

The name 'cat' comes from 'concatenate', and that is exactly what cat does when supplied with multiple text files. When used with only one file argument, the cat command concatenates that file with a null file, then sends the file to stdout, the terminal screen. In English, this displays the contents of the file on your screen. Displaying files with cat has the disadvantage of not stopping the scroll at every screenful, you must use <ctrl-s,ctrl-q> to stop and start the output respectively. To join two or more files into a single file, issue:


next up previous contents
Next: Naming Files Up: Basic File Commands Previous: Basic File Commands
World Wide Web Administrator
1/5/1999