24

Return scrolls forward. How do I scroll backward one line at a time?

2
  • I disagree with your choice of accepted answer. The cYrus's answer provides a more constructive/universal solution. Commented Feb 28, 2016 at 15:52
  • 1
    @АндрейБеньковский when using an embedded system that doesn't have less, and there's no practical way to install it, cYrus's answer is not helpful. Given how ubiquitous IoT devices with an OS with unusable half baked compliance with open sources are, I would hardly call "just use less" as a universal solution either. Commented Dec 31, 2019 at 1:21

5 Answers 5

9

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

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

21

Use less instead.

Less is a program similar to more (1), but which allows backward movement in the file as well as forward movement.

5
  • From the manpage of 'more' => "More is a filter for paging through text one screenful at a time. This version is especially primitive. Users should realize that less(1) provides more(1) emulation and extensive enhancements."
    – Shadok
    Commented Feb 9, 2012 at 16:11
  • 4
    In some Unixes, more and less are links to the same program! Commented Feb 9, 2012 at 16:20
  • 15
    so "less is more" is what you are saying?
    – horatio
    Commented Feb 9, 2012 at 19:48
  • 11
    That is more or less what he was saying.
    – Hennes
    Commented Nov 14, 2014 at 16:27
  • more and less produce very different results when used on /etc/hostname (or any other file whose content fits in one screen). With -FX options, less will behave like more though. I now use alias more='less -FX'
    – loxaxs
    Commented May 29, 2017 at 10:18
13

Scroll backwards with b.

This worked for me for more where more -V gives

more from util-linux 2.25.2

From the man page of more:

b or ^B
    Skip backwards k screenfuls of text. Defaults to 1. Only
    works with files, not pipes.

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

4

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

0
0

From more, use v to start vi or vim, then CTRL-E to move downward line by line, and CTRL-Y to move upward line by line.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .