[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Increasing the number of bash history



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Feb 24, 2016 at 08:16:01PM +0800, EenyMeenyMinyMoa wrote:
> Hi,
> I want to increase the number of bash history.
> 
> $ history
> ==omitting==
> 1996 history
> 
> After entering commands more than ten times,
> I relaunched the terminal to see
> 
> $ history
> ==omitting==
> 1996 history
> 
> I've added the following lines to /home/eeny/.bashrc about a year ago.
> 
> HISTSIZE=77700
> HISTFILESIZE=77700
> HISTCONTROL=ignoredup
> 
> After executing the folloing commands and rebooting,
> $ export HISTSIZE=91000
> $ export HISTFILESIZE=91000
> $ export HISTCONTROL=ignoredup
> the result of
> $ history
> is same.

Because you are telling it: HISTCONTROL=ignoredup (strangely, my doco spells
it "ignoredups", in plural) means to ignore duplicates (usually this is what
you want). Try entering different command lines (e.g. "echo bim" then "echo
bam") to test.

If you don't want to have duplicates ignored, for whatever reason, just
unset HISTCONTROL.

I have mine set to "ignore both" -- it then ignores command with leading
spaces too. Thus I can easily decide that I don't want to have some
command in the history: I tend to do that for somewhat dangerous commands
I don't want repeated "by accident".

regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlbNn7YACgkQBcgs9XrR2kZdzQCfQVF079RCNjLK+Ivj4Du9H7TY
7U0AniAgSrDgdoTvVu8GFhXE0BwzFM+7
=2nl6
-----END PGP SIGNATURE-----


Reply to: