Record a terminal session to a log file so troubleshooting work can be reviewed or shared without relying on memory. Use a clean workflow: reset the screen, capture the session, run a command for evidence, exit correctly, then review the transcript.
You are troubleshooting a legacy system and must document exactly what was typed and what the system returned. Clear the screen to reduce noise, record the session to a log file, capture a hostname check as evidence, then end the session cleanly and review the transcript.
Session transcripts support peer review, change records, and escalations. Logging your steps also protects you when diagnosing systems with inconsistent behavior.
script.
hostname during the recorded session.
clear to reduce noise before
capturing evidence.
script with an explicit
output filename.
hostname.
exit.
cat or
less.
clear
Clearing the screen removes unrelated output and produces a cleaner transcript. It does not erase shell history; it only redraws the terminal view.
script lab53.log
script
records everything printed to the terminal during the
session and writes it to the specified file. This produces a
shareable transcript of the troubleshooting process.
hostname
Running hostname inside the recorded session
provides a simple identity artifact showing which system the
transcript applies to.
termhost.localdomain
exit
When script is running, you are inside a
subshell created for the recording session. Exiting cleanly
stops the recording and writes the closing footer to the
log.
cat lab53.log
# OR
less lab53.log
Use cat for quick output or less
for paging through longer transcripts. This confirms the
recording completed successfully.
Script started on ...
hostname
termhost.localdomain
Script done on ...
The recording session may not have been exited properly.
Ensure you run exit from inside the
script subshell.
Confirm the filename passed to
script. If no name was provided, the default
typescript file may have been created instead.
Clear the screen before starting and avoid running unrelated commands during the recorded session.
Remove the session log if it is no longer needed. This lab does not modify system configuration.
rm -f lab53.log
The transcript file is removed and no artifacts remain from the session.
clear
: Clears the terminal display.
script <file>
: Records a terminal session and writes the transcript to a
file.
hostname
: Prints the system hostname.
exit
: Ends the current shell session.
cat <file>
: Outputs a file to standard output.
less <file>
: Views a file interactively with paging.