more and less

Print the contents of one or more files to the screen.

Format

   more file-list
   less file-list

Summary

The more command is similar to cat, but displays its output one screen at a time. The less command is similar, but has significantly more features. These commands are often used with a pipe (|) to format the output of other Unix commands.

Arguments

The file-list is one or more pathnames of ordinary files that the command is going to read and print.

Notes

When the more command runs, you may:

When using less, press the j or k keys to scroll up and down one line at a time and b to scroll up a page at a time.

Examples

To print a file on screen one screen at a time:

z123456@turing:~$ more prog1.cpp

To format the output from the cat command:

z123456@turing:~$ cat -nvet | more

To be able to scroll back and forth through a long list of files:

z123456@turing:~$ ls -al | less