Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

3 Answers 3

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
before scrolling
after
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 ./myscript.sh or first executing screen and then ./myscript.sh 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.