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
Related videos on Youtube
Author by
jenkhai
Updated on September 18, 2022Comments
-
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 almost 13 yearsYes 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' almost 13 years@Sayan There isn't, sorry.
-
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 olderscreen
) 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 almost 9 years- definitely looks like that "height" was meant instead of "width".