7

I had run a program that resulted in many more lines of output than my current terminal window height. As a result, I could only see partial results...is there any way to get the full output?

I am using the bash shell.

1
  • 1
    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
    Commented Aug 6, 2015 at 20:21

3 Answers 3

8

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
3
  • 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
    Commented Jul 19, 2011 at 15:24
  • @Sayan There isn't, sorry. Commented Jul 19, 2011 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
    Commented Jul 19, 2011 at 21:05
0

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

0

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?"

1
  • - definitely looks like that "height" was meant instead of "width".
    – Cbhihe
    Commented Aug 6, 2015 at 20:22

You must log in to answer this question.

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