How to make save output text to the terminal continuously to a file?

People, all welcome!

How to make save output text to the terminal continuously to a file?
You need to save everything written in the terminal for 1 day, all of the text in a single file.
Where any setting can be made? Maybe there is a program that will monitor the terminal and from there copy all into a file?

Do not offer please, every command in the terminal handles save: command > output.txt

Thank you.
April 4th 20 at 13:19
2 answers
April 4th 20 at 13:21
Solution
Thank you all, have a cool thing called a script!
Using the script command output.txt writes everything to a file.
Using the exit command stops.
April 4th 20 at 13:23
Add to the end of /etc/profile:
function log2syslog
{
 the declare COMMAND
 COMMAND=$(fc-ln -0)
 logger -p local1.notice-t bash -i -- "${USER}:${COMMAND}"
}
trap log2syslog DEBUG


Add to the end of /etc/rsyslog.conf:
local1.* /var/log/cmdline

Restart rsyslog:
/etc/init.d/rsyslog restart

The audit will be in the file /var/log/syslog and /var/log/cmdline

Find more questions by tags LinuxCommand lineUbuntuTerminal