Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

SSD-friendly history



The zsh history file is probably the one file that causes the most
wear of the SSD drive:

  setopt APPEND_HISTORY
  setopt HIST_IGNORE_DUPS
  setopt HIST_EXPIRE_DUPS_FIRST
  HISTSIZE=100500
  SAVEHIST=100000

I.e. every time a zsh writes the history file when it exits, it
writes a new copy of the history file with some lines removed from
the top and some added at the end.  (The history file is about 4
MB big resulting in about 100 MB to 1 GB writes every day.)

I'd really like to have a mechanism that appends to the history
until some maximum size is reached and then truncates it to some
much smaller size, e.g.

  HISTSIZE_MAX=200000
  HISTSIZE_TRUNCATE_TO=100000

So the history would only be rewritten every couple of months.
(This probably conflicts with the DUPS options.)

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt




Messages sorted by: Reverse Date, Date, Thread, Author