Output exceeding terminal window height

5,228

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:
5,228

Related videos on Youtube

jenkhai
Author by

jenkhai

Updated on September 18, 2022

Comments

  • jenkhai
    jenkhai almost 2 years

    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.

  • jenkhai
    jenkhai almost 13 years
    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.
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' almost 13 years
    @Sayan There isn't, sorry.
  • tcoolspy
    tcoolspy almost 13 years
    @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.
  • Cbhihe
    Cbhihe almost 9 years
    - definitely looks like that "height" was meant instead of "width".