When I execute a command, the console prints a lot of information. Due to the limited screen height, it cannot display all the information, as shown in the following figure:
Question: What are some good ways to view all the information printed on the screen?
You can use less or tee
<你执行的命令> | less
<你执行的命令> | more
Simpler idea:
命令 > xxx.log
Save in textFor example:
cat tail more less
Learn about pipe commands
I’m going to talk about something that has nothing to do with the solution. (For the solution, see the netizen’s reply above)
The information displayed on the console is placed in the graphics card frame buffer. This capacity is limited and is not saved at that level. It is thrown away after being displayed. This mechanism determines that there is no way to solve this problem at that level (the original design was not designed to solve this need)
I remember that I used to press pageup+shift on the console, and I could barely scroll up one screen. , it’s unclear now.
If you want to solve this problem, use a pipe to connect less; or use something similar like xterm in xwindows, you can see the cache displayed before.
Use screen or tmux, so that no matter what terminal you use, you can easily view the historical output, search, and various other benefits.