How to scroll backwards when displaying file using "more" command?
There's only one operating system where what Shadok says in comments to another answer is actually the case. It isn't even a Unix. Guess which operating system is the one whose more
command(s) only give(s) you the Unix user experience of 1988.
On Solaris:
You have two choices of more
command: /usr/bin/more
and /usr/xpg4/bin/more
. The former doesn't have a back one line command. But the latter does. It is k, optionally prefixed by a number to indicate a different number of lines. The xpg4
in the directory name references the X/Open Portability Guide Issue 4, a 1992 standard for Unices that preceded the Single Unix Specification.
Further reading
- more(1), page(1). SunOS man pages. 1997.
On FreeBSD and MacOS 10:
/usr/bin/more
and /usr/bin/less
are links to the same file, which is GNU less
. Invoked via more
it tries to follow the POSIX/SUS specification for more
. The Single Unix Specification specifies that the command for scrolling back one (or more) lines is k, optionally prefixed by a number to indicate a different number of lines, just like Solaris.
Further reading
- more(1). FreeBSD man pages. 2009.
- more. The Open Group Base Specifications Issue 6. 2004.
- more(1). MacOS 10 manual pages. 2008.
On Linux:
The more
command is the BSD more
version 5.19, from 1988. It doesn't have a key sequence for going backwards by a line, only one for going backwards by a screenful.
Further reading
- more(1). Linux man page. 1992.
Use less
instead.
Less is a program similar to more (1), but which allows backward movement in the file as well as forward movement.
Scroll backwards with b.
This worked for me for more
where more -V
gives
more from util-linux 2.25.2
For context, this was in a Postgres 9.6.1 Docker container where uname -a
returns
Linux 85c8072dc7eb 4.9.4-moby #1 SMP Wed Jan 18 17:04:43 UTC 2017 x86_64 GNU/Linux
I came in to find an answer quickly but couldnt find one hence went back to the good old
man more
you can use k
to scroll a line backwards or [n]k
to scroll back n lines