Linux Screen: Recording Screen logs

Source: Internet
Author: User

Linux Screen: Recording Screen logs

Screen is the Linux window manager. You can create multiple screen sessions, and each screen session can create multiple window windows. Each window is like an actual ssh terminal.

Screen details:

Linux Screen ultra-Concise tutorial

Common Screen commands in Linux

Zabbix sends Screen graphical reports by email

Linux virtual terminal command Screen usage

Linux tips: use Screen to manage your remote sessions

The following describes how to record screen logs.

Method 1:

When starting, add the option-L (Turn on output logging.) to generate the screenlog.0 file in the current directory.

Screen-L-dmS test indicates to start a session in disconnected mode. The session name is test.

Screen-r test connects to the session. All screen outputs in the session are recorded in the screenlog.0 file.

Method 2:

If option-L is not added, press ctrl + a H under screen session to generate the screenlog.0 file in the current directory.

Press ctrl + a H for the first time, and the Creating logfile "screenlog.0" will be displayed in the lower left corner of the screen to start logging.

Press ctrl + a H again, And Logfile "screenlog.0" closed will be displayed in the lower left corner of the screen. Stop logging.

The preceding two methods have one disadvantage: when multiple screen sessions are created, each session logs to the screenlog.0 file. Contents in screenlog.0 are messy.

The solution is as follows, so that each screen session window has a separate log file.

Add the following line at the end of the screen configuration file/etc/screenrc:

Logfile/tmp/screenlog _ % t. log

% T indicates the name of the window, which corresponds to the-t parameter of screen. Therefore, when we start screen, we need to specify the window name, for example:

Screen-L-t window1-dmS test indicates to start the test session. The window name of the test session is window1. Screen logs are recorded in/tmp/screenlog_window1.log. If the-L parameter is not added at startup, press ctrl + a H under screen session, and the log will be recorded in/tmp/screenlog_window1.log.

This article permanently updates the link address:

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.