How to record operation logs on linux Terminals

Source: Internet
Author: User
How to record the operation logs under linux terminal-Linux general technology-Linux programming and kernel information, the following is a detailed description. On a linux terminal, we can record operation logs to facilitate the check of possible errors and avoid screen scrolling restrictions. Commonly used tools include screen, script, and tee.

1. screen -- screen manager with VT100/ANSI terminal emulatio

> Screen-L
Here is our operation
> Exit
A file name like this will be generated after the end: screenlog.0
> More screenlog.0
In this way, you can view the operations you just performed and find possible problems.

2. script -- make typescript of terminal session

> Script
Our operations
> Exit
Generate a file like this: typescript
> More typescript
Click here to view our operations

3. tee -- read from standard input and write to standard output and files

This command can read the terminal input and output to the terminal or file. Sometimes it can be used to record the possible output of make and other commands to a large amount of content output to the terminal to the file. This allows you to easily record the logs of these commands.

> Make 2> & 1 | tee make. log
Of course, we can also directly redirect to a file.
> Make. log

PS: 2> & 1 is used to record error logs
If you want to filter the control symbols, try to use the "col" command like this:

$ Cat screenlog.0 | col-B> screenlog

Or

$ Cat typescript | col-B> scriptlog
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.