View console information in linux?
PHP中文网
PHP中文网 2017-05-16 13:21:07
0
6
842

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?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(6)
洪涛

You can use less or tee

  • <你执行的命令> | less

  • <你执行的命令> | more

仅有的幸福

Simpler idea: 命令 > xxx.logSave in text
For example:

$ ls -l > tmp.log
$ cat tmp.log 
曾经蜡笔没有小新

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template