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

Use the script command of linux to record the process of terminal interactive conversation

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Xiaobian to share with you the use of linux script command recording terminal interactive session process, I hope you read this article after the harvest, let us discuss it together!

The script command can be used as a record of the interactive terminal session process, preserving the entire process of user input and system output. For later inquiry and study, this is a very useful tool for beginners, for keeping records of work, and for those preparing to write materials.

In the following syntax, the output file is used to store all the on-board session procedures. If no output file is specified, all session procedures are written to the default file typescript in the current working directory.

Syntax format: script [parameter][file]

Common parameters:

- a appends session records to typescript files or specified files, preserving previous contents-c runs specified commands instead of interactive shell-q quiet run mode

Reference Example

A simple session record:

[root@linuxcool~]#script Script started, file is typescript [root@linuxcool~]#date Mon Sep 23 21:07:14 CST 2019 [root@linuxcool~]#uname-r 3.10.0 - 123.el7.x86_64 [root@linuxcool~]#exit exit Script done, file is typescript [root@linuxcool~]#cat typescript Script started on Mon 23 Sep 2019 09:07:09 PM CST [root@linuxcool~]#date Mon Sep 23 21:07:14 CST 2019 [root@linuxcool~]#uname-r 3.10.0 - 123.el7.x86_64 [root@linuxcool~]#exit Script done on Mon 23 Sep 2019 9 09:07:23 PM CST After reading this article, I believe you have a certain understanding of the process of using linux script command to record terminal interactive sessions. If you want to know more, welcome to pay attention to the industry information channel. Thank you for reading!

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