How to scroll one page at a time in Linux at the command line?
Solution 1:
The same ls | more
although most people use the ls | less
command as it has more features, such as scrolling back as well as forwards, and searching for text.
To scroll forwards a screen press space. To scroll back a screen press 'b'. To search for some text type /something
.
And as always man less
for more details.
Solution 2:
First, the equivalent to Windows's dir
is ls
(to see just file names) or ls -l
(to see file names and metadata).
Often you don't need to do anything at all as most terminal environment let you scroll back a few hundreds of lines (depending on configuration) using a scroll bar or (often) with Shift+PgUp and Shift+PgDn.
If you have very long output or want to search, you can pipe into more
(i.e. ls -l | more
) the same way you did on Windows, but most people use less
(ls -l | less
), an improvement on more
which gets its name from its ability to also go backwards (amongst other features). Another less common alternative to more
is most
.