
My favourite aliases…
June 24, 2011Something I recently (embarrassingly) discovered is that bash supports the concept of aliases, which are like shorthand for commonly used commands. Ubuntu comes with a few as default already in your .bashrc, e.g. ‘ll’ for ‘ls -alF’ (long listing). You’re free of course to add your own in .bashrc, so here I present some of the ones I use:
alias chx='chmod +x'
alias rvim='sudo vim' (if you use VIM that is
)
alias sagi='sudo apt-get install -y'
alias sagr='sudo apt-get remove'
alias sagu='sudo apt-get update'
alias saar='sudo add-apt-repository'
I find that especially the apt ones save a lot of typing. Hope you find them useful!
(oh yeah, just put the lines in your ~/.bashrc and run ‘source ~/.bashrc’)
you can also put them in a separate file ~/.bash_aliases which is easier to read and quite useful if you want to copy them
Actually, I keep my .bashrc synced between my systems with Ubuntu One so its just as easy with one file, but yes using .bash_aliases seems more organised.
My favorite “alias” for apt-get, apt-cache, dpkg and other is the “wajig” program.