.bash_histoty

Ralph E. Kenyon, Jr. diogenes at xenodochy.org
Thu Apr 21 20:42:17 UTC 2005


On Thu, 21 Apr 2005 12:42:59 -0400, Rick Stevens  
<rstevens at vitalstream.com> wrote:

> 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!                -
> ----------------------------------------------------------------------

Is it possible to alter the functioning of bash_history?

I would like to see a duplicate entry treated as follows:

Bring it to the bottom (deleting the prior entry)

So that the "adjusted" history has a list of commands, without duplicates,  
in the order that they were last used.

Is it possible to "hack" this functionality in in some way?







-- 
Ralph E. Kenyon, Jr.
http://www.xenodochy.org/ralph.html
191 White Oaks Road
Williamstown, MA 01267-2259
Phone: 413-458-3597

Home pages:
http://www.xenodochy.org
http://www.ballroomdances.org
-------------------------------------------------------
FIGHT SPAM http://www.xenodochy.org/diogenes/antispam.html
(If you are thinking about collecting my email address, read the above  
page first!)
--------------------------------------------------------
Keep our semantic environments and cyberspace clean.
Always report errors discovered while surfing the web.
------------------------------------------------------
My favorite saying (from general semantics):
It's not that seeing is believing, believing is seeing,
and we're much better at believing than we are at seeing.
http://www.xenodochy.org/ex/quotes/santayana.html




More information about the Redhat-install-list mailing list