Forrest logo
back to the script tool

script:tldr:314c3

script: Record timing information (data is outputted to the standard error).
$ script -t 2> ${path-to-timingfile}
try on your machine

The command "script -t 2> ${path-to-timingfile}" is used to create a script session and record the timing information of the session to a file specified by "path-to-timingfile".

Here's a breakdown of the command:

  • "script": It is a command that creates a new shell session and records all the activity within that session.

  • "-t": It is an option with the "script" command that enables the recording of timing information. This means that it will record the time at which each command is executed.

  • "2>": This is a file descriptor redirection operator that redirects the standard error stream (file descriptor 2) to a file.

  • "${path-to-timingfile}": It is a placeholder representing the path to the timing file where the timing information will be saved. You need to replace it with the actual path to the file when using the command.

By executing this command, the script session will start, capturing all the commands and their execution timings, and save the timing information to the specified timing file.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the script tool