简体   繁体   English

脚本命令-bash linux终端

[英]script command - bash linux terminal

I am running the cmd 我正在运行cmd

script install-log.txt

the terminal successfully returns 终端成功返回

Script started, file is install-log.txt

If I begin typing commands and receiving output to the screen 如果我开始输入命令并在屏幕上接收输出

lsblk
fdisk -l
ls
echo ok

when I check the install-log.txt 当我检查install-log.txt时

nano install-log.txt

it is empty. 它是空的。

I thought all cmd was supposed to be saved there until the session is finished? 我以为所有cmd应该保存在那里,直到会话结束?

I am using Arch-Linux installation CD, and wanted to save this log to record my installation setup cmds. 我正在使用Arch-Linux安装CD,并希望保存此日志以记录我的安装设置cmds。

You need to terminate script operation by running 'exit' command. 您需要通过运行“退出”命令来终止脚本操作。 That wont exit your terminal as such. 那样不会退出您的终端。 Then you can view your log file. 然后,您可以查看您的日志文件。

Here is the duplicate with more detailed info -> Bash script: Using "script" command from a bash script for logging a session 这是重复的副本,其中包含更多详细信息-> Bash脚本:使用bash脚本中的“ script”命令记录会话

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM