Posted by: Cacophonix February 19, 2012
UNIX help
Login in to Rate this Post:     0       ?        
 Comp,

depends on what shell you're running.

Bash is most common (comes default with ubuntu, archlinux) and for that you need to add the alias to ~/.bashrc OR a better way would be to add it to ~/.bash_aliases given that you have sourced ~/.bash_aliases from your bashrc. 

Everytime you invoke the shell, bash checks the bashrc file to see what configuration defaults to start with and if you have your alias set there, then it uses that too. 

So in your .bashrc or your .bash_aliases (i keep mine in aliases cuz i have a tonne of them and so makes it easier to manage) you set your alias like you would normally with

alias [your-alias-name] = "[whatever]"

Once you've saved your file, you can use the 'source' command to reload your configs like so:

source ~/.bash_aliases (or whatever file u wrote into).





Read Full Discussion Thread for this article