Re: Where is the history stored (bash)?



On 2006-01-23, bob the builder wrote:
>>
>> > say for example I wanted to clear my history for my current session
>> > only, so that it doesn't end up in ~/.bash_history, how do I?
>>
>
>
> I think I figured out this part, if you:
>
> unset HISTFILE
>
> the shell will not write to ~/.bash_history when your session
> terminates

That doesn't clear your history; it prevents bash from writing it
to your history file when you log out.

> "If HISTFILE is unset, or if the history file is unwritable, the
> history is not saved."
> http://www.gnu.org/software/bash/manual/bashref.html
>


--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
.