Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

3 Answers

up vote 6 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
1  
@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
add comment

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

share|improve this answer
add comment

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
add comment

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.