Exploring the "more" command

By Alvin J. Alexander, devdaily.com

The Unix more command lets you scroll through large files, or large amounts of output from other commands.

To scroll through the contents of a large file named "large_file" you can use the more command like this:

more large_file

As a quick aside, I see a lot of people do the same thing this way:

cat large_file | more

and I just wanted to note that this is not necessary.

Once the more command has control of the screen you can use the [UpArrow] and [DownArrow] keys to scroll up and down through the file, one line at a time; the letter f to move forward one screen at a time; the letter b to move backwards one screen at a time; and you can search using the / key, just like you do when using the vi editor. There are actually a bunch of additional commands you can use, and I recommend that you look at the more man page on your system (type man more) for more information.

The other way the more command is used is to pipe output into it, like this:

ls -al | more

or this:

ps auxwww | more

devdaily logo