Answer the question
In order to leave comments, you need to log in
How to make terminal text output permanently saved to a file?
People, all welcome!
How to make terminal text output permanently saved to a file?
It is necessary to save everything that will be written in the terminal for 1 day, all text into one file.
Where can I make settings? Maybe there is a program that will monitor the terminal and copy everything from there to a file?
Just do not suggest, please, save each command in the terminal with handles: command > output.txt
Thank you.
Answer the question
In order to leave comments, you need to log in
Thank you all, there is a cool thing called a script!
Using the command script output.txt writes everything to a file.
With the exit command, it stops.
Add to the end of /etc/profile :
function log2syslog
{
declare COMMAND
COMMAND=$(fc -ln -0)
logger -p local1.notice -t bash -i -- "${USER}:${COMMAND}"
}
trap log2syslog DEBUG
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question