logoalt Hacker News

ta8903last Thursday at 9:29 AM2 repliesview on HN

Something that should be mentioned is starting a command with a space doesn't add it to your history in most shells, really useful for one-off commands that you don't want cluttering your history.

Also, increase your `$HISTSIZE` to more than you think you would need, there have been cases where it helped me find some obscure command I ran like 3 years before.


Replies

account42last Thursday at 1:28 PM

HISTCONTROL=erasedups can also help keeping more obscure commands in your history, at the expense of context around commands.

l72yesterday at 11:12 AM

Also a good thing to remember if you are ever dealing with credentials:

  $  APIKEY=asdfdfds
  $ curl -H "x-api-key: $APIKEY" https://example.com