hidden bash history settings every developer should know

bashhistoryprivacy4 replies · 251 views · started
  1. Today i learned i can keep a command out of bash history by starting it with a space, as long as HISTCONTROL includes ignorespace or ignoreboth. Ubuntu's default .bashrc uses ignoreboth, so it probably already works for many people.

    also, history | grep was way more useful once I added timestamps with HISTTIMEFORMAT. now I can see exactly when I ran a migration. why aren't these teh defaults everywhere?

    10
  2. hmmmm quick q is your HISTCONTROL already set? xD Check with echo $HISTCONTROL.

    DNS. its always DNS

    thinking

    2 0 helpful
  3. Better than hiding sercets: dont put them on the command line at all. Use environment files or prompt for them, since they can also show up in prcoess lists.

    0 2 helpful
  4. been there man HISTSIZE conrtols how many commands are kept in memory and HISTFILESIZE how many are saved to ~/.bash_history. Increase both for longer history. lmk how it goes

    7 0 helpful

Reply to this topic

Sign in or create an account to reply.