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.
Asked
Active
Viewed 49 times
0

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
-
1Most 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 Answers
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
-
Can this be added to any startup of a terminal? and automatically saved with a date id? – user1767754 May 31 '16 at 06:16
-
@user1767754 You could try adding it to the bottom of your `.bashrc` – Andreas Louv May 31 '16 at 08:19