Home » Questions » Computers [ Ask a new question ]

timestamps for events in a linux terminal

timestamps for events in a linux terminal

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.

Asked by: Guest | Views: 84
Total answers/comments: 1
Guest [Entry]

"You can add

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

to your .bashrc to add timestamps for used commands.

I haven't found any terminal emulator that supports timestamps.

You can try to patch bash to support syslog: http://www.juzzy.com/index.php/files/4-bash (but I'm not sure it works 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.

Another option is to monitor your network traffic."