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.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
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
You can use Shift+Page Up/Down to scroll the current output.
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?"