238

I recognize that Up/Down will give you the command history. But, how do you look at past output by scrolling up and down?

I have used Shift+Page Up/Page Down, Alt+Shift+Up/Down and Page Up/Page Down but none of these seem to work.

It is a Redhat Linux box.

Stefan
  • 27,908
  • 4
  • 53
  • 82
Jane Doh
  • 2,883
  • 3
  • 15
  • 17

15 Answers15

271

SHIFT+Page Up and SHIFT+Page Down. If it doesn't work try this and then it should:

Go the terminal program, and make sure
Edit/Profile Preferences/Scrolling/Scrollback/Unlimited
is checked.

The exact location of this option might be somewhere different though, I see that you are using Redhat.

LostMyGlasses
  • 3,074
  • 20
  • 28
meyumer
  • 5,063
  • 1
  • 17
  • 21
131

Shift+Fn+ UP or DOWN on a Macbook will allow you to scroll.

A.D.
  • 4,487
  • 3
  • 38
  • 50
Lauren
  • 1,508
  • 1
  • 12
  • 16
  • exactly what I was looking for for Ubuntu Server. Thanks! – dcoffey3296 Mar 04 '14 at 21:25
  • 4
    Works well on CentOS vm in Mac host – Miro Markaravanes Sep 10 '14 at 00:20
  • 1
    Thank you. Works for me (Ubuntu Server inside VirtualBox VM on Mac OSX10.10) – Chris Jacob Dec 29 '14 at 23:39
  • 1
    Thanks for this Lauren, and thanks @anizzomc. I was on my macbook pro running Ubuntu server in virtual box and was having a heck of a time trying to figure this out. – CaseyB Feb 22 '15 at 21:30
  • Shift + Ctrl + Up / Down works for me on Ubuntu laptop – Anthony Dec 20 '15 at 08:02
  • 1
    As the comments show, this is the only correct answer. Everyone else is talking about terminal emulators, which is not what the OP is asking. It is the only thing which worked for me on Ubuntu Server 14.04 emulation in Parallels on Macbook Pro – Roobie Nuby Jan 04 '16 at 13:55
  • I Would love to hear from the OP on this answer. Shift Pg-UP and Shift pg-Down are the canonical answer which are documented not to work in VMware, so maybe this doesn't work either... – BenPen Aug 18 '16 at 17:59
  • 2
    that's simply because your PageUp/PageDown keys are mapped to Fn+Up/Down, it won't work in other keyboards. And Fn is not a real key that the OS recognizes (except on Macs) – phuclv Jun 17 '18 at 06:00
89

Alternative: you can use the less command.

Type in console:

"your_command" | less   

This will allow you to scroll with the up and down arrow keys.

Basically your output has been piped with the less command.

Drew Gaynor
  • 8,292
  • 5
  • 40
  • 53
igauravsehrawat
  • 3,696
  • 3
  • 33
  • 46
  • 1
    Interesting enough this was the only way that actually worked when using the shell on a FreeNAS install disk. – ZeroInputCtrl Jul 26 '15 at 15:59
  • 3
    FreeNAS is FreeBSD based, and there you scroll differently. First you press `scroll lock` to get into paging mode and then use plain arrows and `page up`/`page down` to scroll. Press `scroll lock` again to get back to typing mode. – arrowd Jun 21 '17 at 18:30
  • 2
    This is the only solution that works on headless servers. Other solutions are for servers with GUI. – learner Mar 26 '20 at 10:30
28

ALTERNATIVE FOR LINE-BY-LINE SCROLLING

Ctrl + Shift + Up Arrow or Down Arrow

Unlike Shift + Page Up or Page Down, which scrolls the entire page, this will help with a smoother line-by-line scrolling, which is exactly what I was looking for.

jacefarm
  • 6,747
  • 6
  • 36
  • 46
Vicky Singh
  • 401
  • 4
  • 6
24

SHIFT + Page Up and SHIFT + Page Down are the correct keys to operate on the linux (virtual) console, but vmware console doesn't have those terminal settings. The virtual console has fixed scroll back size, it sounds like it's limited to video memory size according to this Linux virtual console Scrolling behavior documentation.

BenPen
  • 383
  • 4
  • 14
  • In order to prevent the Matthew Effect, from now on I will try to upvote the second and correct answer to encourage ppl to answer the questions who already have a correct answer. – WesternGun Dec 13 '17 at 09:11
  • Does this mean that VMWare intercepts those keystrokes? – Gringo Suave Sep 20 '18 at 16:24
19

Another alternative, that might be already installed on your system is to use GNU screen :

# This starts screen which adds basic window management in terminals
screen

# This starts the copy mode you can use to scroll
<CTRL-A> [

# Now use the arrows to scroll

# To exit copy mode, do
<ESC>

See man screen for much more useful options (multiple windows, ...)...

Joel.O
  • 1,980
  • 3
  • 16
  • 26
13

Shift Pageup/End works for me.

Rjj
  • 131
  • 1
  • 3
10

It seems as though this is not easily possible: The Arch Linux Wiki lists no way to do this on the console (while easily possible on the virtual terminal).

You could use tmux scrolling:

Ctrl-b then [ then you can use your normal navigation keys to scroll around (eg. Up Arrow or PgDn). Press q to quit scroll mode.

Alternatively you can press Ctrl-b PgUp to go directly into copy mode and scroll one page up (which is what it sounds like you will want most of the time)

Community
  • 1
  • 1
serv-inc
  • 35,772
  • 9
  • 166
  • 188
8

VM Ubuntu on a Mac...fn + shift + up/down arrows

duderweb2
  • 101
  • 1
  • 3
  • 1
    this is [exactly the same as Lauren's answer above, but with the OS mentioned](https://stackoverflow.com/a/20019785/995714) – phuclv Jul 03 '18 at 10:54
5

I ran into the same problem with VMWare workstation with Ubuntu guest, turns out VmWare doesn't support scrolling back up from the server view. What I did was to install x GUI, then run xterm from there. For some reason it runs the same, but lets you scroll the normal ways. Hope this helps future readers in VmWare virtual boxes.

kana
  • 605
  • 7
  • 12
3

In some VPS hostings (like linode) you have to click Ctrl+A and then ESC. Exit with double ESC too.

T.Todua
  • 53,146
  • 19
  • 236
  • 237
2

Fn + Up/Down can scroll Terminal in Mac OS X 10.11

barbsan
  • 3,418
  • 11
  • 21
  • 28
likid1412
  • 963
  • 8
  • 15
1

Press the Shift key when scrolling the mouse up/down works for me when loggin in Ubuntu using Terminal ssh in Yosemite.

ohho
  • 50,879
  • 75
  • 256
  • 383
1

PERSISTENT, longterm solution

Add this line to your ~/.screenrc

termcapinfo xterm* ti@:te@

Now you can create a screen, and scroll it up/down with your mouse; Like you normally do.

Slake
  • 2,080
  • 3
  • 25
  • 32
  • 2
    Where do you see OP talking about `screen`? This should be removed. – Atralb Oct 26 '20 at 22:01
  • 1
    @Atralb if you think an answer is inappropriate you can downvote or flag it ;) no offense Slake that solution was probably helpful for you, but indeed does not really fit here – xeruf Feb 25 '21 at 17:00
0

For some commands, such as mtr + (plus) and - (minus) work to scroll up and down.