2 ms·
One of the first things I do on a fresh install is set my history to two million lines: HISTSIZE=1000000 HISTFILESIZE=2000000 I also have a one-line s
by carapace 8y ago
One of the first things I do on a fresh install is set my history to two million lines:
HISTSIZE=1000000
HISTFILESIZE=2000000
I also have a one-line script "did" that searches for a pattern in the recent commands (from previous sessions):
grep "$1" ~/.bash_history | tail
This is so simple but I couldn't begin to estimate how much time it has saved me over the years.
The history file is saved in my backups of home dir.
For what it's worth I sometimes am concerned with privacy, but it's important to remember that you must specify: privacy from whom?
For most cases I trust file permission flags, either only I'm root or someone else is and it wouldn't be appropriate to hide history from the sysadmin (i.e. on my employer's machines.)
- - - -
edit: TIL
> In bash 4.3 and later you can also use HISTSIZE=-1 HISTFILESIZE=-1