Next: Listing files and directories
Up: Files and directories
Previous: Other interesting directories
Contents
A few different ways of listing the contents of a text file are discussed
below.
- 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.
- 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.
- 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.
- Use a text editor. For example: vim, emacs etc.
Next: Listing files and directories
Up: Files and directories
Previous: Other interesting directories
Contents
Amit Jain
2013-04-22