0

How to use linux "tee" command in bashrc for automatic logging everything you write in shell and get on screen parallel to somefile ?

Jonathan.Brink
  • 23,757
  • 20
  • 73
  • 115
Leone
  • 19
  • 1

1 Answers1

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
  • 1
    thanks 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
  • i have just to make a tutorial how to install some envionment – Leone May 19 '16 at 13:32
  • problem solved: "script mylog" works fine - thank You – Leone May 19 '16 at 13:52
  • No problem, glad it helped :) – Simone May 19 '16 at 14:23