script
The "script" is a command line tool that allows users to record and save their terminal sessions. It is primarily used for creating textual records of a user's interactions with the command line.
To start recording, simply type "script" in the terminal, and it will create a new shell and start logging all input and output. This includes all commands executed, their output, errors, and even control characters.
By default, the recorded session is saved in a file called "typescript" in the user's current directory. However, users can specify a different filename if desired.
The recorded output can be useful for various purposes, including documenting a sequence of commands, sharing a session with others, or debugging an issue by reviewing the entire interaction.
To stop recording, users can input the "exit" command or press Ctrl+D, which will terminate the shell and save the recorded session.
The "script" command also includes some useful options, such as "-a" to append the output to an existing file instead of overwriting it, or "-c" to execute a specific command within the recording session directly.
Additionally, the "script" tool provides options to control the output format, such as "-q" to suppress recording the start and stop messages, or "-t" to timestamp each line in the output file.
The recorded file can be later reviewed using any text editor or command line tools for analysis, filtering, or extraction of specific content.
Overall, the "script" command is a handy tool for capturing and reviewing command line sessions, allowing users to keep a detailed record of their work and share it when needed.
List of commands for script:
-
script:tldr:314c3 script: Record timing information (data is outputted to the standard error).$ script -t 2> ${path-to-timingfile}try on your machineexplain this command
-
script:tldr:3205c script: Start recording in file named "typescript".$ scripttry on your machineexplain this command
-
script:tldr:681be script: Start recording in a given file.$ script ${logfile-log}try on your machineexplain this command
-
script:tldr:693bc script: Append to an existing file.$ script -a ${logfile-log}try on your machineexplain this command
-
script:tldr:999cd script: Execute quietly without start and done messages.$ script -q ${logfile-log}try on your machineexplain this command