How do you scroll up/down on the console of a Linux VM [closed]
Asked Answered
F

15

239

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.

Floaty answered 6/3, 2013 at 18:23 Comment(6)
Are you using an xterm (or equivalent)?Fachini
no redhat enterprise linuxFloaty
I mean how are you accessing the shell. Which terminal emulator?Fachini
I am just accessing the linux server from a VM console.Floaty
Is that a vmware thing? If you're not using a regular terminal emulator, you won't have terminal functions like scrollback.Fachini
I guess it makes a difference whether Jane Doh is looking at an X session with gnome terminals or the actual console output that comes as text to a "VM Console Screen" Ancient history here, at 2013, but it's an interesting question over all.Adherent
F
272

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.

Farreaching answered 6/3, 2013 at 18:36 Comment(5)
That would be a completely different question. OP was talking about stuff like gnome terminalWritein
Cool, thanks! How would you go about setting the scrollback size from a native ('real') terminal?Adolescence
Only the first line of this answer is useful on the Linux console, the rest might be useful on a GUI terminal like gnome-terminal, though unlimited is not needed.Uke
@GringoSuave gets it.Chemical
For those of you who didn't find it work, don't forget to turn NumLock offDiverting
J
131

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

Jaimie answered 16/11, 2013 at 14:52 Comment(8)
exactly what I was looking for for Ubuntu Server. Thanks!Glyph
Works well on CentOS vm in Mac hostApograph
Thank you. Works for me (Ubuntu Server inside VirtualBox VM on Mac OSX10.10)Hydroxyl
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.Monarchy
Shift + Ctrl + Up / Down works for me on Ubuntu laptopKowalczyk
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 ProPeri
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...Adherent
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)Frecklefaced
R
90

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.

Rafter answered 10/1, 2014 at 6:18 Comment(3)
Interesting enough this was the only way that actually worked when using the shell on a FreeNAS install disk.Guncotton
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.Witticism
This is the only solution that works on headless servers. Other solutions are for servers with GUI.Sheaves
M
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.

Menedez answered 15/11, 2016 at 6:25 Comment(2)
I needed scrolling for a Chromebook which doesn’t have Page Up and Page Down. Works well.Kweiyang
Believe this requires CONFIG_VGACON_SOFT_SCROLLBACK to be enabled on the linux console.Uke
A
25

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.

Adherent answered 8/3, 2013 at 14:4 Comment(2)
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.Squaw
Does this mean that VMWare intercepts those keystrokes?Uke
E
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, ...)...

Esmeralda answered 8/12, 2016 at 8:48 Comment(0)
P
13

Shift Pageup/End works for me.

Pitterpatter answered 1/4, 2019 at 9:56 Comment(2)
This should be a comment.Leftwich
I cant comment yet :(Pitterpatter
I
11

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)

Ignite answered 10/2, 2016 at 11:11 Comment(0)
W
8

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

Wellestablished answered 4/10, 2017 at 3:21 Comment(1)
this is exactly the same as Lauren's answer above, but with the OS mentionedFrecklefaced
P
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.

Petitioner answered 18/7, 2016 at 7:42 Comment(1)
Heavyweight solution. Another might be to install sshd and log in remotely.Uke
S
3

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

Sinew answered 8/1, 2019 at 21:20 Comment(0)
M
2

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

Mede answered 6/1, 2016 at 12:0 Comment(0)
C
1

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

Chalcedony answered 9/11, 2015 at 4:56 Comment(0)
R
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.

Rabjohn answered 1/4, 2018 at 9:14 Comment(2)
Where do you see OP talking about screen? This should be removed.Swat
@Swat 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 hereAlyse
R
0

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

Roxane answered 3/3, 2014 at 17:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.