Use script commands to record Linux terminal sessions

Source: Internet
Author: User
Tags perl script
Use the script command to record the Linux terminal session-Linux Enterprise Application-Linux server application information. The following is a detailed description. I used ssh to manage a linux server in the company. Because I have more than one account, I want to find a software that can record terminal sessions. Finally, I found

Start recording session:
Script-t 2> demo. timing-a demo. session
-T indicates the output time data of the recording.
-Option a outputs the recorded file (additional)

Note: When using scripts, do not use interactive programs or programs that process windows, such as vior top. They will destroy the output result of the session.

You can even record the editing process of vim.

In addition, the log file records any command line program you use and the steps you take to complete a task. If you need to edit a file in the script, consider exiting the script session and then using the script? A (it adds a new session after the old session) edits the file and then restarts the session.

End recording session:
Exit

Playing a recording session:
Scriptreplay demo. timing demo. session

Note: The preceding two commands are part of the Linux util-linux software package.

Some linux distributions have script commands but do not have scriptreplay commands, the scriptreplay command is actually a perl script (this means that the recorded content can also be played in windows (as long as it is a terminal that supports ANSI control code can be reproduced, and there are some garbled characters in cmd), good) you can find the source code package of util-linux software package, decompress the package, and search for scriptreplay to find the script.
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.