Is there a way to automatically log in terminal content? Or any app available?
- open a terminal
- type this
bash | tee logfile
- Now do the things you wanted to do in the terminal
- afterwards, type this:
exit
less logfile
Well, yes. There are multiple ways to log in during one session. I meant to run it as a default without having to start and stop it. I can see that guys have created sets of scripts for that, but I was wondering if there is an option in MATE Terminal or an application, which I would just install.
You are looking for script [options] [file] command.
Hi Juan
Here is what you want:
Open the menueditor:

Create a new menuitem:
And that is all. You now have a logging terminal. It puts the output of all "logterm" terminal sessions in one logfile.
If you want a logfile per "logterm" terminal session (using several "logterms" at the same time), you can change the menuitem to this:

This all thanks to Eugene (@ugnvs) for mentioning the script command ![]()
Oh, by the way:
If the description above is too complicated and you want an automatically generated menuitem you can copy/paste the code block below in a terminal and press enter:
cat <<\EOF > "$HOME/.local/share/applications/logterm.desktop"
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=mate-terminal -x bash -c "script -f script_$$"
Icon=xterm-color
Name=logterm
Comment=logging terminal
EOF
chmod a+x "$HOME/.local/share/applications/logterm.desktop"
Nice, but I have some unrecognized characters in the output. Maybe because of bad encoding or a different line ending?
Those are color coding characters.
if you use 'cat' to display the file you will see the colors.
