Ubuntu – How to allow scrolling to view complete command output in the command-line

command lineexecute-commandoutput

An example:

When I enter compgen -c to view all possible terminal commands I get something like this:

ll
ls
which
if
then
else
elif
fi
case
esac
for
select
while
until
do
done

and quite a bit more… but I can't see it all. When I scroll to the top of the output, I can't see the command I entered so it's obvious that the rest of the output is also not visible.

Best Answer

Make the scroll buffer larger. For the default terminal see edit > profiles > edit > scrolling and increase "limit scrollback". Example:

enter image description here

That will make it show more lines when you scroll up.

You can also use

compgen -c | more
compgen -c | less
compgen -c | most

(most requires it to be installed sudo apt-get install most) to make it show 1 page at a time.

Or if you have a LOT of lines that even the buffer has trouble with put the result in a text file and view that one.

compgen -c > temp.txt
vi temp.txt

vi you can use things like :2 to go to page 2.