top | item 10165240

(no title)

DEinspanjer | 10 years 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 "

discuss

order

michaelhoffman|10 years ago

`cd` can be critical in grepping for how a file in a particular directory was made.

knodi123|10 years ago

who actually types pwd? I've had it in my prompt since I learned about PS1.