Hello Giovanni
In Linux, the command script will do what you are asking for. Take a look at the man page for this command.
In short, you can type script output.txt and all subsequent commands and output will be saved to the output.txt file. Here is an example of the commands you can use:
$ script output.txt
Script started, file is output.txt
$ ls
output.txt testfile.txt foo.txt
$ exit
exit
Script done, file is output.txt
You can then read the output.txt file which will have all of the CLI commands and outputs you saw on the terminal.
I hope this has been helpful!
Laz