.bash_histoty

gerrynix gerrynix at yahoo.com
Thu Apr 21 21:07:29 UTC 2005


--- "Ralph E. Kenyon, Jr." <diogenes at xenodochy.org> wrote:
> 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?

Add the following lines to your ~/.bash_profile

HISTCONTROL=ignoredups # obvious what this does
HISTIGNORE=pwd:date:ls # edit the command names to suit
export HISTCONTROL HISTIGNORE

Note: HISTIGNORE is followed by a colon separated
list of command names that you do NOT want to 
save to your .bash_history at all. Keeps the history
file a little neater and cleaner.
--
Nix
> 
> -- 
> 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
> 
> _______________________________________________
> Redhat-install-list mailing list
> Redhat-install-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-install-list
> To Unsubscribe Go To ABOVE URL or send a message to:
> redhat-install-list-request at redhat.com
> Subject: unsubscribe
> 




More information about the Redhat-install-list mailing list