Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: What's your .bashrc?
15 points by nol13 on Nov 17, 2017 | hide | past | favorite | 9 comments
What are some good aliases to make annoying things less annoying for me?


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 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"
   ...


A mishmash of stuff I have copied from various public "dotfiles" repos.

Quite a few gems in here: https://github.com/mathiasbynens/dotfiles


echo "sleep 1" >> ~/.bashrc


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.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: