Search⌘ K
AI Features

Recording Program Interaction

Explore how to record your command-line interactions using the script command. Learn to capture terminal sessions for logging, debugging, or sharing purposes, create and append logs, and understand best practices for using script in different scenarios.

We'll cover the following...

The script command

We’ve seen that the shell records the history of the commands we run on the system, but we can also record the output of those commands thanks to the script command. This is incredibly useful for logging a shell session to share with others to get debugging help or demonstrate how we did things. The official description in the documentation for script even states that one of the uses is for students who “need a hardcopy record of an interactive ...