> For the complete documentation index, see [llms.txt](https://wiki.smhuda.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.smhuda.com/pentesting/infrastructure-security/network-infrastructure/log-a-terminal-session.md).

# Log a terminal session

When you are ready to start recording a log file, type:

```
script screen.log
```

Now, until you stop the script, all input and output in the Terminal will be stored in screen.log. When you are done, just type:

```
exit
```

Your screen.log file will stored in the local directory. If you want to redirect it, use an absolute pathname such as `~/screen.log`. This will do exactly what you are looking for.<br>
