Home  >  Q&A  >  body text

View console information in linux?

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中文网2713 days ago766

reply all(6)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 13:23:07

    You can use less or tee

    • <你执行的命令> | less

    • <你执行的命令> | more

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-16 13:23:07

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

    $ ls -l > tmp.log
    $ cat tmp.log 

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-16 13:23:07

    cat tail more less

    reply
    0
  • 怪我咯

    怪我咯2017-05-16 13:23:07

    Learn about pipe commands

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-16 13:23:07

    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.

    reply
    0
  • ringa_lee

    ringa_lee2017-05-16 13:23:07

    Use screen or tmux, so that no matter what terminal you use, you can easily view the historical output, search, and various other benefits.

    reply
    0
  • Cancelreply