139

How can I scroll in bash using only the keyboard? If it's not possible in bash, are there any other shells that support this?

  • 33
    This is not a feature of the shell, it's a feature of the terminal emulator. See What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'? What terminal are you using? – Gilles Jan 5 '13 at 17:22
  • 3
    It's kind of sad that four people considered this question good enough to spend a few minutes on an answer but no one bothered to vote it up. – Marco Jan 5 '13 at 19:15
  • 1
    @jordanm Sadly, hats ended yesterday – Michael Mrozek Jan 5 '13 at 21:40
  • 2
    @MichaelMrozek That was a short "Winter". – jordanm Jan 6 '13 at 1:54
  • 1
    I think this is too broad. As mentioned, scrolling is a terminal emulator feature, not a shell feature. There are really very many terminal emulators many of which implement scrolling in different ways, or not at all. – Anko May 11 '15 at 17:39
158

In "terminal" (not a graphic emulator like gterm), Shift+PageUp and Shift+PageDown work.

  • 2
    I just tried this in the latest version of PuTTY (b0.62) and it works. Just for the reference. Cheers. – Mario Awad Jan 8 '13 at 21:55
  • 1
    Shift+Uparrow and shift+Downarrow also work for line at a time scrolling. – Joe Jan 13 '13 at 7:03
  • 1
    for me its ctrl-shift+Uparrow – Hermann Ingjaldsson Sep 9 '16 at 10:43
  • 6
    Why does every version of linux have to remap the page up key to some random combination of Fn, Ctrl, Shift, Alt, and Option? Every time I want to scroll up, I have to play a game of Twister with both my hands. It's almost like the developers are trying to tear basic navigation out of the hands of the users. Page up means Page up, stop making me dance a jig on my keyboard. – Eric Leschinski Dec 15 '16 at 4:07
29

I use the default terminal in Ubuntu 14 (bash) and to scroll by page it is Shift + PageUp or Shift + PageDown to go up/down a whole page.

Ctrl + Shift + Up or Ctrl + Shift + Down to go up/down by line.

  • 2
    Nice CTRL+SHIFT+UP, just like SHIFT+UP in Cygwin. – Jaime Hablutzel May 5 '15 at 23:41
  • 2
    +1 for CTRL+SHIFT+UP – ruuter Oct 19 '16 at 12:27
16

This depends on your terminal emulator, not the shell you are using. I personally use GNU Screen. From the description:

Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

You can use C-a [ to enter scrollback mode. From here, you can scroll with the keyboard and even copy and paste. The mode can be exited from by using the Esc key.

12

Keyboard: Apple/Mac

Terminal/Emu: OSX Terminal

Shell: bash

fn + up_arrow: page up
fn + down_arrow: page down
cmd + up_arrow: line up
cmd + down_arrow: line down
  • 2
    This adds nothing, appears to be mac specific (which would not be a bad thing if properly marked as such), and does not apply to bash but to the terminal emulator (which would be useful if we knew what it was). – hildred Aug 8 '15 at 15:51
  • 1
    I have no key marked fn, nor one marked cmd. – Anthon Aug 8 '15 at 17:32
  • 2
    @Anthon Because you don't use a mac? OP never specified operating system in the question. – DisplayName Jan 2 '16 at 14:03
  • for ITerm you can use either fn with either shift, command, or option plus the arrows for direction – lacostenycoder Feb 27 at 19:19
  • cmd + up is helpful 👍 – killscreenmike Mar 10 at 6:07
4

In most terminals that I known you can use Shift+PageUp and Shift+DownDown for scrolling. Note that some terminals don't support scrolling, or use a very limited history buffer. In the latter case, you may want to increase the limit, if it is configurable.

As an alternative, use a pager; for example, less.

4

On FreeBSD, you can use Scroll Lock to toggle screen scrolling mode. Press it once, then use Up/Down, PgUp/PgDown, Home/End to scroll. Press it again to jump back down and resume typing.

1

If you use VirtureBoxVM on Mac OS, press SHIFT + fn + up_arrow ( or down_arrow) to roll.

  • 1
    @Thomas It may be a wrong answer but it is an answer, not a comment. – Hauke Laging Sep 3 '17 at 10:06
  • @HaukeLaging not a wrong answer, it just worked for me on for VMWare (while the other answers didn't) – Bob Ebert Apr 8 at 15:37
0

There is an another way to show everything in terminal organized write to the last to any command " | less " and by clicking SPACE BUTTON you can scroll down an up.

Examples

  • ps aux
  • ps aux | less

  • ps fax

  • ps fax | less

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.