Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a script which, when I run it from PuTTY, it scrolls the screen. Now I want to go back to see the rros but when I scroll up I can see the past commands but not the output of the command.

How can I see the past output?

share|improve this question

If you don't pipe the output of your commands into something like less, you will be able to use Putty's scroll-bars to view earlier output.

Putty has settings for how many lines of past output it retains in it's buffer.

before scrolling
after scrolling back (upwards)

If you use something like less the output doesn't get into Putty's scroll buffer

with less
after using less

share|improve this answer
why is putty different with the native linux console at this point? – David Dai Dec 14 '12 at 3:31

I would recommend using screen if you want to have good control over the scroll buffer on a remote shell.

You can change the scroll buffer size to suit your needs by setting:

defscrollback 4000

in ~/.screenrc, which will specify the number of lines you want to be buffered (4000 in this case).

Then you should run your script in a screen session, e.g. by executing screen ./ or first executing screen and then ./ inside the session.

It's also possible to enable logging of the console output to a file. You can find more info on the screen's man page.

share|improve this answer

Shift+Pgup/PgDn should work for scrolling without using the scrollbar.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .