Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"Based on bash history data" is an interesting point, because it highlights that you can use your history to periodically check what you do inefficiently in the terminal, and which aliases you still need to add to your config: compute some statistics on the number of 1-word and 2-word commands you use the most, and see if they are more than e.g. 4 letters.

With zsh: "history 1 | awk '{print $2}' | sort | uniq -c | sort -n"

With bash I think this should be "history" instead of "history 1".



I make one change to every new .bashrc file.

I change this:

  HISTSIZE=1000
  HISTFILESIZE=2000
to:

  HISTSIZE=1000000
  HISTFILESIZE=2000000
You would be surprised how useful this one change has been, answering historical questions easily, like how to generate that rsa key, or what packages did I install for that project last year.

You can usuall answer questions with ^r instead of the man page. Or maybe:

  "history | grep -C 10 <foo>"


While we’re on the subject of shortcuts, I have `awk1` mapped to `awk '{print $1}'` and the same up to awk9. It’s not that I can’t type it but it breaks my flow for such a simple use case.


`history 200000 | awk '{print $2" "$3}' | sort | uniq -c | sort -n`




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: