You can use more command to display files with paging through text one screenful at a time. You can use more command in the interactive mode which enables you to perform multiple operations on the output screen as listed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
## create a long file with 200 lines > myfile; i=1; while [ $i -le 200 ]; \ do echo "$i" >> myfile; ((i++)); done cat myfile ## displays the content of myfile at once more myfile ## displays one screenful at a time ## enter ==> scroll one line at a time ## space ==> scroll one screenful at a time ## q ==> exit ps -ax | more ## also works with pipe ## command option in interactive mode more myfile ## display the output in interactive mode ## below is the list of commands supported ## in interactive mode, any other key results ## a bell sound ## h or ? ==> display help ## SPACE ==> scroll current screen size ## z arg ==> scroll current screen size (arg=new screen size). ## RETURN ==> scroll one line at a time ## d or ^D ==> scroll current scroll size ## q or Q ==> Exit more ## s ==> skip forward k lines of text, defaults to 1 ## f ==> skip forward k screenfuls of text, defaults to 1 ## b or ^B ==> skip backwards k screenfuls of text, defaults to 1. ## ' ==> go to the place where the last search started ## = ==> display current line n ## /pattern ==> search for kth occurrence of regular expression, defaults to 1 ## n ==> search for kth occurrence of last regular expression defaults to 1 ## !command ==> execute command in a subshell ## v ==> start up an editor at current line ## ^L ==> redraw screen ## :n ==> go to kth next file, defaults to 1 ## :p ==> go to kth previous file, defaults to 1 ## :f ==> display current file name and line number ## . ==> repeat previous command |