Is there any way to get Output History from the Ubuntu terminal? As a log of everything that rolled into a terminal?
Is there any way to get Output History from the Ubuntu terminal? As a log of everything that rolled into a terminal?
Well, it's not very nice to read, but it works:
Before starting to use the terminal (assuming you use bash
, which is the default shell in Ubuntu):
bash | tee bash.output
In the end, you will have a bash.output
file in your home
with the output, but everything together, without showing where everything came from.
There is another way and I can not stop commenting. In the personal folder there is a file called .bash_history (/home/user/.bash_history). If you open it by nautilus, give ctrl + h to view the hidden files and you will find it. If you want to see directly in the shell, type:
cat /home/username/.bash_history | more
Press enter to display the following.
Output from a terminal:
H1 ) set a long terminal history, and cut & paste the terminal to a file
H2 ) use the command script file
(saves the session to file
) - script
has several options that can be useful.
Editing in more detail:
H1) the terminal maintains a history accessible by scroll-bar (by default 512 line, configurable in the terminal's profile). If, using the mouse, we select the desired output to make cut & paste within your preferred editor.
H2) the script command was created for questions like the one raised in this question. (see man script
); try
script log
... executar alguns comandos
(CTR-D)
... e vê o conteudo do ficheiro log