0

I would like to log anything done in the terminal to be logged. Any given input and as well the output of that input. The command history will give you the inputs. I know how to redirect outputs to file but i need a more general approach so that i can have daily log about what input was given and what the output was.

Community
  • 1
  • 1
user1767754
  • 23,311
  • 18
  • 141
  • 164
  • Possible duplicate: http://askubuntu.com/questions/161935/how-do-i-log-all-input-and-output-in-a-terminal-session – augurar May 30 '16 at 21:06
  • 1
    Most terminal emulators provide a logging facility, and there is the [`script`](http://linux.die.net/man/1/script) command. – chepner May 30 '16 at 21:27
  • @augurar Thanks for the hint, but isn't that record on request? i want to have it always turned on – user1767754 May 31 '16 at 06:06

1 Answers1

4

script from util-linux can be used for that:

% script -q out_file.txt
% ls
out_file.txt
% exit
% cat out_file.txt
% ls
out_file.txt
% exit

See man 1 script.

Andreas Louv
  • 46,145
  • 13
  • 104
  • 123