Your shell is likely configured to write to the file, instead of appending to it.<p><pre><code>    shopt -s histappend
</code></pre>
In your .bashrc should do. To have it write after every command take a look at <a href="http:&#x2F;&#x2F;unix.stackexchange.com&#x2F;a&#x2F;1292" rel="nofollow">http:&#x2F;&#x2F;unix.stackexchange.com&#x2F;a&#x2F;1292</a>