The more command

The more command



What does it do ?

Puts files on screen one page at a time. It also allows you to search a file for a certain expression.


How is it used ?

more -options +line number +/certain expression filename

-option
-c scrolls the file through your screen one line at a time
-d displays Hit Space to continue
-f does not count lines that are a continuation of another line
-l does not pause at the ^L(form feed) character
-n sets the number of lines to be shown on screen to n lines
-r puts ^M where carriage returns are
-s condenses the number of blank lines down to one(where multiple blank lines occur)
-v shows all control characters as ^C, in which C is the character used to generate the control character
-w waits at the end of the file for you to give the command to quit
+line number tells unix which line to begin with in file
+/certain expression searches for certain expression


Examples and remarks

If you type in the command:

more assignment1.c

you will see the file assignment1.c displayed, starting from the beginning of the file and showing as much of the file as can be shown on the screen at one time. The screen can be cleared by hitting the space bar, at which time the file will be scrolled so that the line that was at the bottom of the screen is the last line to disappear from the top of the screen. By doing this you can see a section of a file at a time until you have run through the whole file.

If you type in the command:

more -option assignment1.c

you cause the desired option to take effect as the file assignmentq1.c is being shown on your screen.

NOTE:

more -option +line number +/certain expression filename(s)

Allows you to view a file with the desired option starting at the desired line number and look for a certain expression in these filename(s).

For more information, you can type:

man more

this will show you the information contained in the man pages on the commad more.



next previous table of contents