How to use linux "tee" command in bashrc for automatic logging everything you write in shell and get on screen parallel to somefile ?
Asked
Active
Viewed 351 times
0
-
Can you explain your problem or requirement with more detail? – user861594 May 19 '16 at 13:25
-
"write"? can you give an example? – Karoly Horvath May 19 '16 at 13:26
-
come on man, show a simple session and its result in the logfile. – Karoly Horvath May 19 '16 at 13:38
-
problem solved: "script mylog" works fine - thanks everybody for help – Leone May 19 '16 at 13:52
1 Answers
1
Assuming you just want to record your shell session in a file, the easiest way is:
script mylog
It just opens a new shell. When you want to stop session recording, just type exit
. After that, your recorded session will be in mylog
file.
Alternatively you can do:
$ tee > mylog
And on another window:
$ tail -f mylog
But this is probably not what you want.

Simone
- 20,302
- 14
- 79
- 103
-
1thanks for reply but i haveto explain what i mean. I want to log everything i am doing in bash to file like a history: command and linux answer, command and linux answer without typing : command tee -a logfile, command tee -a logfile, – Leone May 19 '16 at 13:26
-
-
-