brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: script -a session.log records everything in your terminal to a file

Terminal
~/tips/tip-terminal-script-record-session

script -q -a session.log

Saves a full terminal session, input and output, to a text file.

When I need a record of what I typed and what came back, script does it without any extra software.

script -q -a session.log
# work as usual, then:
exit

script starts a new shell and writes all input and output to the file. -a appends instead of overwriting and -q hides the start and stop messages. With the Linux util-linux version, -c 'command' records a single command instead of a shell. The file contains escape codes, so view it with less -R. Remember that anything you type, including passwords at visible prompts, ends up in the log.

Further reading: script manual page

More Terminal tips ioreg -rn AppleSmartBattery | grep CycleCount Terminal can save your windows and tabs as a window group Export a Terminal profile to a .terminal file and import it on another Mac mc hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x700000029}]}' All Terminal tips (116) All topics

Link