in reply to CPAN Module to determing overlap of 2 lists?

Yes, if I set HISTFILESIZE to -1, then bash would maintain an unlimited history file

I wish I'd known that, I just keep making the number bigger!

The following doesn't help with the current problem, but: this will be a trivial problem in the future if you add HISTTIMEFORMAT='%Y%m%d-%H%M%S ' to ~/.bashrc, or to /etc/bash.bashrc. Then start a new terminal session and issue a few commands, then issue history | tail and you'll see what I mean. You'll have to do something like history | sort -k 2 | grep 'what you want to see', as somehow things are still out of sequence. I think that happens to me because I generally have 3 or more terminal windows open, doing things in each, and the history file gets written (I think) when the bash session ends,

Replies are listed 'Best First'.
Re^2: CPAN Module to determing overlap of 2 lists?
by wazat (Monk) on Aug 11, 2020 at 20:15 UTC

    I never looked at HISTTIMEFORMAT.

    If I set HISTTIMEFORMAT, bash captures the time in the history file as what appears to be epoch seconds. This would definitely speed things up.

    #1597175957 echo $$ #1597175963 echo $HOME #1597175967 ls -la #1597176017 ls #1597176017 ls #1597176018 ls

    As you mention, the history file gets written when the shell exits. I too usually have multiple shells at the same time. I guess if we need to separate different sessions we could set HISTFILE to a distinct file name in .bashrc