Linux Bash Shell Tutorial :How to save terminal session typescript or logfile in Linux
Sometime as a beginner, intermediate or expert system admin, we need to keep a record on what we did to the system whenever we faced with system problems. One way we can do this is by recording the Linux terminal session.
We can save terminal session in Linux by using the built in "script" command. To record any terminal session type in script command and followed with the file name that you want.
orca@Positive-Space:~$ script log.01012015
I make it a habit to include the date in all my logs file name for future reference. Once you entered the command, the terminal will save everything that you type in the terminal and will save it in current directory location. In this example, "log.01012015" file will be saved in "user home" directory.
saving terminal session |
To stop the terminal saving,you can use exit command .
orca@Positive-Space:~$ exit
stopping terminal saving |
The saved file can be viewed using any text file editor.