Bug 500819 - RFE: add HISTCONTROL="ignoreboth" to /etc/bashrc or /etc/profile
RFE: add HISTCONTROL="ignoreboth" to /etc/bashrc or /etc/profile
Product: Fedora
Classification: Fedora
Component: setup (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Ondrej Vasik
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-05-14 07:44 EDT by Stefan Assmann
Modified: 2009-05-20 08:36 EDT (History)
2 users (show)

See Also:
Fixed In Version: setup-2.8.5-1.fc12
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-05-20 08:36:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Stefan Assmann 2009-05-14 07:44:05 EDT
.bash_history currently keeps all the duplicate entries if you for example type the same line twice. That's annoying when you search through the history.
By exporting HISTCONTROL="ignoreboth" duplicates and lines starting with a space will be ignored.

It would be nice to have this as default for every user so I'd suggest to add this to the appropriate place (/etc/bashrc or /etc/profile or what else suits)

excerpt from "man bash":
              A  colon-separated  list  of values controlling how commands are
              saved on the history list.   If  the  list  of  values  includes
              ignorespace,  lines  which  begin with a space character are not
              saved in the history list.  A value of ignoredups  causes  lines
              matching the previous history entry to not be saved.  A value of
              ignoreboth is shorthand for ignorespace and ignoredups.  A value
              of erasedups causes all previous lines matching the current line
              to be removed from the history list before that line  is  saved.
              Any  value  not in the above list is ignored.  If HISTCONTROL is
              unset, or does not include a valid value, all lines read by  the
              shell parser are saved on the history list, subject to the value
              of HISTIGNORE.  The second and subsequent lines of a  multi-line
              compound  command  are  not tested, and are added to the history
              regardless of the value of HISTCONTROL.
Comment 1 Ondrej Vasik 2009-05-20 08:36:57 EDT
Thanks for suggestion, as it is default in Gentoo/OpenSuSe/Debian/Ubuntu, I'll change this that way in RAWHIDE as well - as I think distro consolidation is good thing. Changed in setup-2.8.5-1.fc12, closing RAWHIDE.

Note You need to log in before you can comment on or make changes to this bug.