# adding date to bash history command

Coming from Solaris to Linux, one thing I’ve missed for years was that the Linux bash *history* command doesn’t show timestamps. Thanks to my colleague, Shinn, I learned about this config settings that can go into .bashrc to solve that problem, and add a few other useful settings, as well. In Debian, the (system) file to modify is /etc/bash.bashrc, and /etc/bashrc in CentOS. Of course, user can modify her/his .bashrc.

`export HISTTIMEFORMAT='%F %T '`

Before:

```
<br></br>  355  vi .bashrc<br></br>  356  history<br></br>  357  history | wc -l<br></br>
```

  
After:  
```
<br></br>  355  2013-03-15 10:07:03 vi .bashrc<br></br>  356  2013-03-15 10:07:17 history<br></br>  357  2013-03-15 10:07:48 history | wc -l<br></br>  358  2013-03-15 10:13:43 cat .bashrc<br></br>  359  2013-03-15 10:57:46 exit<br></br>  360  2013-03-15 13:22:12 history<br></br>  361  2013-03-15 13:22:35 more .bashrc<br></br>
```

`export HISTSIZE=1000` – extends history from the default 500 most recent commands, to 1000.

`export HISTCONTROL=ignoredups` – removes duplicates from history  
`export HISTCONTROL=ignoreboth` – I’m not sure about this one.

*Please add other config options you find useful.*