Tuesday, May 6, 2008

HowTo create permanent aliases in Ubuntu

When you frequently need to type the same long command on your terminal, you need to create aliases so you can save time. To create permanent aliases, follow this command:
1. Open your ~/.bash_aliases file with text editor you like then add the alias you want. (If you don't have .bash_aliases, create a new one on your home directory).
Example:
alias any_name='ssh user_id@any_address.ca'

2. Uncomment these 3 lines on your ~/.bashrc file

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

3. Restart your terminal, if it doesn't take effect you need to reboot system. I only need to restart the terminal to make the aliases take effect (I'm running 8.04).

3 comments:

Anonymous said...

or you do this:

http://ubuntuforums.org/showthread.php?t=486478

thisway you only have to restart your terminal

:)

narky said...

Thanks!

Mujibur rahman said...

Hey, no need to restart machine.
You just have to do a simple process.
After changing bash_aliases
mujib:$ source ~/.bashrc

Then It will work.