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

Re: Increasing the number of bash history



I found in ~/.bashrc

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

Leaving this part alone,
the result of history was also the same.
That was not the case in wheezy.

I've edited ~/.bashrc, so now

$ cat ~/.bashrc
==omitting==
HISTCONTROL=ignoreboth
==omitting==
#HISTSIZE=1000
#HISTFILESIZE=2000
==omitting==
HISTSIZE=-1
HISTFILESIZE=-1
HISTCONTROL=ignoredups
$ echo $BASH_VERSION
4.3.30(1)-release

And after entering a few commands(though they are meaningless),

$ history
==omitting==
2004 a
2005 b
2006 c
2007 d
2008 e
2009 exit
2010 history

The number of history surpasses 2000 now.
Thanks, tomas and real bas.

EenyMeenyMinyMoa


2016-02-25 3:24 GMT+08:00, real bas <realbas89@gmail.com>:
> With bash version 3 you can set to infinity the history size and size of
> history file of terminal
> edit file ~/.bashrc
> change HISTSIZE=1000 to HISTSIZE=-1 //history size of terminal
> change HISTFILESIZE=2000 to HISTFILESIZE=-1 //size of history file
>
>
> 2016-02-24 8:19 GMT-04:00 <tomas@tuxteam.de>:
>
>> -----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: