Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 had run a program that resulted in many more lines of output than my current terminal window width. As a result, I could only see partial results...is there any way to get the full output?

I am using the bash shell.

share|improve this question
Please change the word "width" in your question title by the word "height". Your accepted answer does not correspond to your wording with "width". – Cbhihe Aug 6 '15 at 20:21
up vote 7 down vote accepted

You could send the output to a file:

$ your_command > /tmp/output.txt

You could then open up that file in any text editor and examine it at your leisure.

Or, you could pipe the output directly to a program such as less that is specifically designed as a text reader and can help you page through data when it is more than a screen-full:

$ your_command | less
share|improve this answer
Yes I am aware of redirection, but I was hoping if there is any way I could resuscitate my last output, fully without having to run the program again. – Sayan Jul 19 '11 at 15:24
@Sayan There isn't, sorry. – Gilles Jul 19 '11 at 15:26
@Sayan: You can only do that if you are running in some sort of terminal that keeps a buffer for you. If you use tmux (or the older screen) you can set them to keep hefty scroll-back buffers so that you can browse and even search the output quite a ways back ... but you have to be running in one ahead of time you can't roll back time and capture output that's already come and gone. – Caleb Jul 19 '11 at 21:05

You can use Shift+Page Up/Down to scroll the current output.

share|improve this answer

In addition to which shell you are using, we need to know which terminal app you are using, for instance Gnome-terminal, or Konsole are the 2 popular ones in Linux. As mentioned by another answerer, SHIFT+PAGEUP is a common keystroke to scroll back through previous screens of terminal output.

P.S. When you said "terminal window width" did you mean "terminal window height?"

share|improve this answer
- definitely looks like that "height" was meant instead of "width". – Cbhihe Aug 6 '15 at 20:22

Your Answer


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.