How do you scroll in a Linux bash window?
September 30th, 2009 | by admin |Im starting to learn how to program in a linux environment using g++. I was wondering how do you scroll the numerous lines of text in the window. For instance, i will get compile a program and get a long list of errors. I will then use my scroll wheel to scroll up to see the first message but will only be able to scroll up for a limited amount of lines. Then i am unable to see any lines before it
I tried using scroll lock but it did not work. Im actually using linux through SSH with PuTTy if that make sense. The problem is that the cursor in the window stays at the bottom most line. Therefore to see the text about the command line i must use the scroll bar.
That’s true. For a long list, you are better off capturing some sort of log file which you can access. This is where piping comes in. I use error as the name of my log file. GCC writes error messages to stderr so if you were to do g++ -o myprog myprog.cc > error you would see the error messages scroll up the screen and disappear. If you were to do:
g++ -o myprog myprog.cc > error 2>&1 though, you would be redirecting stderr to stdout which you are already redirecting to error.
Piping is worth looking up, and no matter what Linux you are using, look up Unix tutorials which will have lots of neat tricks using piping, the programs grep and sed and so forth which you will find you CAN use. Terminals can be fun.
4 Responses to “How do you scroll in a Linux bash window?”
By menotu3169 on Sep 30, 2009 | Reply
I’m not 100% sure it will work, but have you tried using the Scroll lock key?
That is, after all, what that button was designed for.
References :
By jplatt39 on Sep 30, 2009 | Reply
That’s true. For a long list, you are better off capturing some sort of log file which you can access. This is where piping comes in. I use error as the name of my log file. GCC writes error messages to stderr so if you were to do g++ -o myprog myprog.cc > error you would see the error messages scroll up the screen and disappear. If you were to do:
g++ -o myprog myprog.cc > error 2>&1 though, you would be redirecting stderr to stdout which you are already redirecting to error.
Piping is worth looking up, and no matter what Linux you are using, look up Unix tutorials which will have lots of neat tricks using piping, the programs grep and sed and so forth which you will find you CAN use. Terminals can be fun.
References :
http://www.google.com/linux?hl=en&q=%222%3E%261%22&btnG=Search
http://wiki.linuxquestions.org/wiki/Piping
http://www.is.ed.ac.uk/itus/sce/linuxunix/unix_redirection.html
By jerry t on Sep 30, 2009 | Reply
I gather you are trying to scroll up in a terminal from the last line of the output to the first but are limited by the "memory" in the terminal. I only know how to adjust this in the terminal called konsole (from KDE). In Settings at the top of the konsole click on history and you can set the history in the konsole output up to unlimited.
Hope this helps
References :
By Hourani on Sep 30, 2009 | Reply
Did you try to increase the history limit? by doing
"$ vim ~/.bashrc"
add to the top
"export HISTFILESIZE=3000"
I think this shall help.
References :