Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the command for Linux to record the session?

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what is the command for Linux to record the session process". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian slowly and deeply to study and learn "what is the command for Linux to record the session process" together!

In Unix system maintenance, sometimes system engineers want to be able to record the progress of a session. For example, when testing the functionality of a system, engineers want to record the steps of the test. This information can be used for tracking analysis when problems arise. For example, sometimes when making training documents, these session records may also be needed to facilitate the trainer to make training documents such as PPT. In short, a system engineer now wants to record the process of a session, can it be achieved in Unix systems?

The main function of script command is character.

In Windows, readers may have used screen recording software that records a certain period of time in the form of video. On Unix, however, sometimes this is not necessary. Because the operating system provides a script command to help system engineers record the progress of a session. This is a relatively obscure command and is not in the POSIX specification. Some Unix operating system versions may not have this feature. Many system engineers may rarely touch this command. But I prefer this order. Simply put, this command allows system engineers to record the entire process of a session or some intermediate operations into a file. This command basically records most keyboard operations, command outputs, and error messages in a file. In other words, basically all the information output on the screen can be saved in this file. The system administrator can then review this file after the fact to obtain the necessary information. How does this command work? As shown below, it is actually very simple.

As shown above, this is the basic procedure used by the script command. First, when a system engineer wants to record a session, he simply enters script at the beginning of the session. Entering this command saves all keyboard actions, screen output, error messages, etc. of the current user to a specific file. If the ps command and the who command are executed above, it is expected that these two commands (the user's keyboard operation), screen output (the execution result of the command), etc. will be saved to the file. When the engineer needs to exit the recording process, he only needs to enter the exit command, and the system will prompt the script done message. Indicates that the system has finished recording.

When system engineers need to view information in this file, they can use cat or vi commands to view the contents of this file. However, depending on the shell version used, their initial results may vary. For example, in some versions, using the cat command to view the file may only show when the command was completed, rather than the user's keyboard operations and screen output. For this reason, the author establishes the vi command. Use vi to view this file and there will be no version differences. If you use the vi typescript command, you can see the specific information in this file. Typically, the entire file contains the following sections.

The first line is comment information. For example,"Script started on Monday, June 15, 2009 at 18:24:21." This prompt indicates when the command started executing. And then in the last line, there's a similar message. However, the last line of prompt information displayed the completion time of this command, showing the completion date and specific time of the command execution. Then the middle part is the command and output result information. If there is an error message during the execution of the command, it will also be recorded here.

Thank you for reading, the above is the "Linux recording session process command is what" content, after learning this article, I believe we have a deeper understanding of what Linux recording session process command is, the specific use of the situation also needs to be verified. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report