script [options] [file]
script
makes a typescript of everything on your terminal session. The terminal data are stored in raw form to the log file and information about timing to another (optional) structured log file. The timing log file is necessary to replay the session later by scriptreplay and to store additional information about the session.
echo date | script
) then keeping ECHO enabled for the pseudoterminal slave enables the standard input data to be viewed on screen while being recorded to session log simultaneously. Note that 'never' mode affects content of the session output log, because users input is not repeated on output.mkfifo foo; script -f fooand another can supervise in real-time what is being done using
cat fooNote that flush has an impact on performance; it's possible to use SIGUSR1 to flush logs on demand.
script
command prepends and appends to the child process output. Due to buffering, the resulting output file might be larger than the specified value.The size argument may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB"), or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.