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."

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

Relevant Pages

  • Re: Newbie: save an interpretation session
    ... editing/interpretation session for next Forth interpreter startup. ... In iForth, every line of input is appended to a history file and all lines ... it on the command line. ...
  • Re: Common History across Shell
    ... history in file from each session *after* the particular session ... What I wanted was multiple sessions can share history (the ... Shell might behave the normal way (maintain ... done on a specific user action. ...
  • GP-CVS-V4.1.0 -- no history file?
    ... With V4.0.0 there is a history inside the session and after exit and restart I can access the last commands of the former session via the ... If it is a default feature: I would like to ask: Are there any parameters, which I must set to the new gnuplot 4.1 to obtain the "old" history mechanism? ...
  • PyDev not saving Ipython History between sessions
    ... One feature I like about Ipython is that it saves the history between ... session in PyDev. ... Is there a command to load the history when I start ...
  • Re: .bash_history in F15/16 randomly truncated/incomplete/damaged
    ... not see the entries of your current session! ... That behavior has always annoyed me, since I always seem to be missing useful parts of my history. ... First, it increases my history size, and second, it appends the current shell's history to the file, not overwrites it, and third, it updates the history file with each command that is entered. ...