How to scroll in a terminal using keyboard?

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?

Asked By: Kshitiz Sharma

||

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.

Answered By: jordanm

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.

Answered By: Philipp Claßen

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

Answered By: isevcik

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.

Answered By: max pleaner

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
Answered By: zero_day

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

Answered By: Huy Nguyễn

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.

Answered By: mwfearnley

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
Answered By: abdelmoumen drici

Linux on Apple / Mac Keyboard (at least on MacBook Pro)

  • Page-up: shift+fn+UpArrow
  • Page-down: shift+fn+DownArrow
  • Line-up: shift+control+UpArrow
  • Line-down: shift+control+DownArrow
  • Home: shift+fn+LeftArrow
  • End: shift+fn+RightArrow
Answered By: GuzmanEscobar

I access a container via an Ubuntu 16.04 LTS terminal, from a Windows machine.
I needed to use space (when inside a bash session on a Docker container running Linux Ubuntu).

Answered By: Chris Halcrow

I don’t have PgUp so I use Fn+Shift+UpArrow

Answered By: Milo Thatch G

Its also depend on your keyboard PageUp/Down and arrow keys layout.
Here is my keyboard layout and I am using Ubuntu.

Keyboard

Answered by @Guzman is working for me.

Page-up: shift+fn+UpArrow
Page-down: shift+fn+DownArrow
Line-up: shift+control+UpArrow
Line-down: shift+control+DownArrow
Home: shift+fn+LeftArrow
End: shift+fn+RightArrow
Answered By: Gagan
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.