How to show date and time in your ubuntu bash history

This post was written by admin on October 4, 2009
Posted Under: General

This is useful tip if there are multiple people maintaining a given server (so you can see when a command was performed) or even if you are the maintainer, but can’t remember exactly when you did or changed something.

First,edit $HOME/.bashrc file by this command:

gedit $HOME/.bashrc

Add this line into the file,save and close it.

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

Logout and back in,and you will get history with date and time like this:

1002  May/09 – 11:46:16 grep log /var/log/maillog
1003  Apr/09 – 14:17:40 passwd test
1004  Apr/09 – 14:50:28 history 15

Related posts:

  1. Show Weather and Set Date/Time in Ubuntu Clock panel applet
  2. How to Clear Login History and Command History in Ubuntu Linux
  3. Remove the History for website just visited in Firefox
  4. How to Clear and Disable Totem’s recent history in Ubuntu 11.04 Unity
  5. How to get colors in man command page

    Tags:

    Add a Comment

    required, use real name
    required, will not be published
    optional, your blog address