next up previous contents
Next: Listing files and directories Up: Files and directories Previous: Other interesting directories   Contents

Viewing the contents of a text file

A few different ways of listing the contents of a text file are discussed below.
  1. cat <filename> This will cause the text of the file to scroll off the screen if the text occupies more than one screen of lines. The command cat can also be used to concatenate multiple files. For example, cat <file1> <file2> will concatenate the two files and then display on the terminal.

  2. more <filename> This will display the file one scornful at a time; press the space bar to advance to the next screen; press RETURN to scroll up one line; and q to quit.

  3. less <filename> The command less is similar to the command more. However less allows you to move backwards in a file using the up/down arrow keys an PageUp and PageDown keys. The command less is also faster than more on large files.

  4. Use a text editor. For example: vim, emacs etc.


next up previous contents
Next: Listing files and directories Up: Files and directories Previous: Other interesting directories   Contents
Amit Jain 2009-08-23