I'd like to ignore all invocations of a command in my bash history, regardless of arguments. For example, to exclude all of ls
, ls -l
, and ls SOME_DIRECTORY
, my understanding is that I'd need to do:
HISTIGNORE='ls:ls *'
I can't use just HISTIGNORE='ls*'
because that also would ignore other commands that happen to start with ls
, which is undesirable. However, needing to specify ls
and ls *
is annoying and error-prone as I add entries to HISTIGNORE
.
Is there a pattern that I can use to match a command by itself and with arguments?
'ls:ls *:cd:cd *'
fromls:cd
.