How to Record Linux Terminal Commands With “script”

Sep 16, 2021, 11:27 am EDT | 4 min read fatmawati achmad zaenuriThe script command lets you record and replay activity in your terminal. It’s helpful when you want to create a reference of the steps you’ve taken or you’re creating a tutorial for others to follow. script outputs a typescript of all the commands you’ve run. It works by dropping you into a sub-shell that logs everything you execute. Your session will be saved as plain text when you leave the shell. This makes script more reliable than redirected input streams. Basic Usage The script command can be run without any arguments: script A new capturing session will start. Your terminal session will be saved to ./typescript in your working directory. You can specify a different file by giving script an argument: script example_session Use your shell to execute the command sequence you want to record. When you’re done, press Ctrl+D or type exit to drop out of the sub-shell. You’ll retu… Click below to read the full story from How To Geek
Read More