187

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?

11 Answers 11

205

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

| improve this answer | |
  • 4
    Shift+Uparrow and shift+Downarrow also work for line at a time scrolling. – Joe Jan 13 '13 at 7:03
  • 9
    for me its ctrl-shift+Uparrow – Fzs2 Sep 9 '16 at 10:43
  • 3
    Ctrl + Shift + Up/Downarrow works for ubuntu 16.04 TSL – Tuan Oct 30 '19 at 2:42
42

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.

| improve this answer | |
17

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.

| improve this answer | |
14

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
| improve this answer | |
  • 4
    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
  • 3
    @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 '19 at 19:19
  • cmd + up is helpful 👍 – killscreen Mar 10 '19 at 6:07
5

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.

| improve this answer | |
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.

| improve this answer | |
1

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

| improve this answer | |
1

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
| improve this answer | |
1

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).

| improve this answer | |
  • 1
    Please consider adding some more information on the virtual environment of your container (such as OS type/version, bash version etc.) so that readers may better assess the applicability of your answer to their specific situation. – AdminBee Jan 16 at 8:15
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
| improve this answer | |
0

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

| improve this answer | |

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.