You're viewing a comment by AltairIV and its responses.

AltairIV Permalink
May 23, 2010, 19:02

I just came across this post. Thanks for the useful summary.

But I'm quite surprised that there's no mention here of the HISTCONTROL variable, which controls the saving of duplicated and space-started lines. The available options (colon-separated) are:

(Don't save commands that begin with spaces, apparently equal to HISTIGNORE="[ ]*")

(Don't save duplicated commands, equivalent to HISTIGNORE="&")

(Combines the previous two options)

(Erase any previous occurrences of a command before saving)

I personally like the last one as it ensures that the most recent usage of the command is saved, rather than the oldest.

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "unix_42": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.