I need to know when a particular system i'm remotely connected to disconnected - so i'd like a way to prefix my terminal commands and output with a timestamp, preferably temporarily- i'd find it an annoyance in most other cases. currently i'm using yakuake/konsole with bash, but if need be, i can use something else.

link|improve this question

77% accept rate
feedback

2 Answers

export PROMPT_COMMAND=date

will make bash print the date before issuing each prompt. That may be enough if the prompt returns on your local machine when the remote system disconnects.

link|improve this answer
feedback

You can add

export HISTTIMEFORMAT="%h/%d - %H:%M:%S "

to You bashrc to add timestamps for used commands.

I haven't find any terminal emulator that support timestamps.

You can try to path bash to support syslog: http://www.juzzy.com/index.php/files/4-bash (but I'm not sure it work or is it good idea at all).

I think the best option is to wrap Your program you use to connect into some bash script that will log date after disconnect.

Other option is to monitor Your network traffic.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.