Linux screen tricks: Log The Screens

Source: Internet
Author: User

Screen is the Linux window manager, the user can set up multiple screen sessions, each screen session can also create multiple window windows, each window is like an operational real ssh terminal.

Screen Explanation: http://www.ibm.com/developerworks/cn/linux/l-cn-screen/

Here's how to record screen logs.

The first method:

Add option-L at startup (Turn on output logging.), screenlog.0 files are generated in the current directory.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/48/86/wKioL1QJQ1-zsceYAABrE371q_I797.jpg "title=" Test.png "alt=" Wkiol1qjq1-zsceyaabre371q_i797.jpg "/>

Screen-l-DMS test means to start a session that is in disconnected mode at the beginning, and the name of the session is test.

Screen-r Test connects the session, and all screen output in the session is logged to the screenlog.0 file.

The second method:

No option-l, after starting, press CTRL + A under Screen session H, also generate screenlog.0 files in the current directory.

The first time you press CTRL + A, the lower left corner of the screen prompts creating logfile "screenlog.0"., Start logging.

Press CTRL + A again, the lower left corner of the screen will prompt logfile "screenlog.0" closed., stop logging.


There is a drawback to the above two methods: When creating multiple screen sessions, each session logs the log to the screenlog.0 file. The content in the screenlog.0 is a bit confusing.

as a workaround , let each screen session window have a separate log file.

Add the following line at the end of the screen configuration file/ETC/SCREENRC:

Logfile/tmp/screenlog_%t.log

%t refers to the name of the Windows window, corresponding to the-t parameter of screen. So when we start screen, we want to specify the name of the window, for example:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/48/87/wKioL1QJSYOCbu7oAAB1Zw9Tfew071.jpg "title=" Window1.png "alt=" Wkiol1qjsyocbu7oaab1zw9tfew071.jpg "/>

Screen-l-T WINDOW1-DMS test means the test session is started and the window name of the test session is Window1. The screen log is recorded in/tmp/screenlog_window1.log. If you start without the-l parameter, press CTRL + A under Screen session H, the log will also be recorded in/tmp/screenlog_window1.log.


This article is from the "Departure-linux Technology Blog" blog, please be sure to keep this source http://qicheng0211.blog.51cto.com/3958621/1549201

Linux screen tricks: Log The Screens

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.