5 ms·
I keep a pretty long bash history, but I don't have it unified among machines or anything. Others have mentioned several handy tweaks for doing this, but I did
by DEinspanjer 11y ago
I keep a pretty long bash history, but I don't have it unified among machines or anything.
Others have mentioned several handy tweaks for doing this, but I didn't see all of the ones I use so I thought I'd share them here. One of the important bits is the HISTIGNORE. I am interested in commands that I might want to search for and run again one day, so I filter out commands I consider to be clutter.
# Configure my history preferences
# Load history substitute into readline rather than immediately executing
shopt -s histverify histreedit
set histappend
# don't put duplicate lines or lines with leading spaces in the history. See bash(1) for more options
export HISTCONTROL=ignoreboth
export HISTIGNORE='&:bg:fg:cd*:clear:ls:pwd:history:exit:make*:* --help:'
export HISTTIMEFORMAT="%m/%d/%y - %H:%M:%S "
- michaelhoffman 11y ago`cd` can be critical in grepping for how a file in a particular directory was made.
- knodi123 11y agowho actually types pwd? I've had it in my prompt since I learned about PS1.
- michaelhoffman 11y agoI use `pwd -P` sometimes.