Script Commands in linux record terminal sessions

Source: Internet
Author: User


In linux, script commands record terminal sessions running script screen. log on ubuntu or other linux systems, and record screen information to screen. log,
A good way to record screen logs until exit... Www.2cto.com # script screen. logScript started, file is screen. log # ls-ltrtotal 76 omitting several lines >>>>>>>>>>>>>>>>>## exitexitScript done, file is screen. log # cat screen. logScript started on # ls-ltrtotal 76 omitting several lines >>>>>>>>>>>>>>>## exitexit Script done on exits abnormally, the log is still recorded. You need to add the parameter script-f ido. log.
Use mkfifo ido. log; script-f ido. log and log on to another terminal. Find the ido. log File, tail-f
It will scroll out the content of your operation. 2. The disadvantage of using a script is that it records all special characters, so the file you enter will be filled with control characters
And ANSI escape sequences. You can use a very simple shell in the script to solve this problem: www.2cto.com SHELL =/bin/bash PS1 = "$" when the script is used, do not use interactive programs or programs that process windows, such as vior top. They will destroy the session
Output result. In addition, the log file records any command line program you use and
Step. If you need to edit a file in the script, consider exiting the script session, and then use script- (
Add a new session after the old session) edit the file and restart the session.

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.