Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use a terminal logging method on my Ubuntu Desktop for the GNOME-terminal (it's good when I use SSH in GNOME-terminal):


  1. As root:

    apt-get install bsdutils
  2. As the normal user:

    mkdir ~/logs
  3. append this to your ~/.bashrc - must be the last line!

    STARTTIME=`date +%F-%Hh-%Mm-%Ss-%N`; script -q -t 2>    \
      /home/USERNAMEHERE/logs/$STARTTIME-timing.txt         \
      -c 'bash --rcfile /home/USERNAMEHERE/.bashrc-cp'      \
      -f /home/USERNAMEHERE/logs/$STARTTIME-log.txt; exit 0
  4. make sure the 1) is the last line of bashrc, then [this is needed to avoid "fork bomb"..]:

    sed -e '$d' /home/USERNAMEHERE/.bashrc > /home/USERNAMEHERE/.bashrc-cp


Rename the filenames to you're needs! You can only play 1 file at one time.

    scriptreplay "/home/USERNAMEHERE/logs/$STARTTIME-timing.txt" \

With this method I can log steps in ncurses menu, great! It's working perfectly.


I need this great terminal logging method in putty too. How can I do that? (so for ex.: I need to log smitty menus on AIX machines with putty too.)

p.s.: Coul my logging method be better? (Can anyone update it?)

share|improve this question
I do not understand the problem. You approach should work also on AIX. – andcoz Apr 30 '12 at 11:55
The question is that I need a logging solution for putty on windows, as the same as the one that I described. – LanceBaynes May 1 '12 at 9:44
PuTTY itself can log, but can't replay the logs. – sendmoreinfo Jan 30 '13 at 22:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.