I'm installing a package and get a load of errors and need to be able to read through all the error messages that come up. Unfortunately the terminal will only display a finite number of lines. How do I go about viewing previous lines or changing the maximum number of lines that can be displayed?
If you are using the standard Terminal program on a Desktop version of Ubuntu...
Choose Edit -> Profile Preferences from the terminal windows global menu.
Choose the Scrolling tab
Set Scrollback to the desired number of lines (or check the Unlimited box).
Then you can use the scrollbar at the side of the terminal to scroll back through the lengthy command output.
If you want to see the data and also run it to a file, use tee, e.g,
spark-shell | tee tmp.out
(spark-shell is just the example interactive program that you might want to capture output from.)
This will allow you to type commands in response to output from the program, but also capture the output to a file.
You could start your command in a script session every action an command output would be saved without interfering with the execution unless |less or >file that forbid to have any interaction with the command.
$ script /tmp/command.out Script started, file is /tmp/command.out $ the_command ... $ exit Script done, file is /tmp/command.out $ less /tmp/command.out
You could use
| to output your command into
For example, if I wanted to read an entire text file that wouldn't fit on screen using
cat, I would use:
cat /home/abcd/Downloads/fileName.txt | more
You can press enter to scroll down one line at a time, and q to exit. Press g to start over.
Hope this could be useful to you.