Ask HN: What's your .bashrc?

15 points by nol13 ↗ HN
What are some good aliases to make annoying things less annoying for me?

11 comments

[ 3.3 ms ] story [ 32.9 ms ] thread
i use a german keyboard and i like these:

alias öö=ll

alias ..='cd ..'

as of bash 4, 'shopt -s autocd' will "execute" a directory by cd-ing to it.
I call fish from my bashrc (because I want it to be my standard shell, but It can cause problems with certain scripts)

I've aliased push to git push, and done the same with git commit.

Edit: Of course the aliases are in my .fishrc, but it's the same in the end :)

Start typing a command and use the arrow keys to find your history of that command:

  bind '"\e[A": history-search-backward'
  bind '"\e[B": history-search-forward'
Pretty much anything that requires sudo I would have an alias like:

   alias apt="sudo apt"
   ...
One alias I use a lot when programming is this one:

  alias todo='grep -r "FIXME" * ; grep -r "TODO" * ; grep -r "XXX" *'
Also, with git (the first line is in my .bashrc, the second in .gitconfig):

  alias ghist='git hist | head'
  hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
You could simplify your first alias with something like this:

     alias todo='egrep -r "(FIXME|TODO|XXX)" .'
I have a bunch of aliases mostly. Any time I find myself typing the same command over and over I'll add a single or two-letter alias. So for Git, 'q' shows me git status, 'a' does git add *, and 'p' does git push origin master. I also have aliases for things like 'tail -f /var/log/nginx/error.log', very handy.