.bash_histoty

Rick Stevens rstevens at vitalstream.com
Thu Apr 21 16:42:59 UTC 2005


Scott Mertens wrote:
> Is the .bash_history file a FIFO type file?  I want to save some of the
> commands I have used so I don't forget them. I just want to be sure the
> file is not completely overwritten once it reaches it's capacity.  Along
> that line, is it possible to increase the number of commands it
> remembers?  With a 200 GIG HD, I'm not worried about it's size.

Technically, the history command is a LIFO (last in-first out) and it's
implemented as a ring buffer (when it's full, the oldest command is
dropped to make room for the new command).

Now, as to ~/.bash_history...it's just a file.  Its purpose is to save
the current "history" ring buffer when your interactive shell exits so
it can be restored when the shell is restarted.  Changing its size won't
affect your history list as it's wiped out and rewritten when the shell 
terminates.

If you want more history commands, you have to bugger the HISTSIZE 
environment variable to change the size of the history command's ring
buffer.  The file is overwritten (or created if missing) and will be
whatever size is needed to save that ring buffer when the interactive
shell exits.
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-                Huked on foniks reely wurked for me!                -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list