Adding Date And Time To Your Bash History
Want to support HowtoForge? Become a subscriber!
Adding Date And Time To Your Bash HistoryThis is a quick but handy addon (RedHat/CentOS) to enhance your bash history (bash > 3.0). It comes in handy particularly if there are multiple people maintaining a given server (so you can see when a command was performed) or even if you are the sole maintainer, but can't remember exactly when you did or changed something. Edit your /etc/bashrc and append to the bottom: export HISTTIMEFORMAT="%h/%d - %H:%M:%S " From next login instead of: 574 tail -f /var/log/maillog you get: 1002 Apr/30 - 11:46:16 grep duncan /var/log/maillog Hope this helps someone;)
|



Recent comments
2 days 13 hours ago
2 days 22 hours ago
3 days 1 hour ago
3 days 2 hours ago
3 days 4 hours ago
3 days 5 hours ago
3 days 7 hours ago
3 days 8 hours ago
4 days 21 min ago
4 days 1 hour ago