Record the linux operation command log-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:
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.