Tuesday, October 5, 2010

Ubuntu terminal Aliases

Pretty interesting and they will save you a lot of time ...... lemme show you with an example:
Lets say you are tired of using "sudo apt-get install" again and again , and want to make an alias to it.... simple!

Follow these steps and you'll be good to go
  • Go to you home folder and create a file named:

.bash_aliases

(This can also be done via the terminal like so:

touch ~/.bash_aliases

  • edit the .bash_aliases file to contain:
alias fmp=’sudo apt-cache search'
  • Save the file and open the file named:

.bashrc

Find the section that is commented out (lines preceded with #’s) to looks like this:

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

  • Uncomment those lines. Save and close and then open a new terminal window.
Just try "fmp packageyouneed"
Simple ... ain't it? :)

No comments:

Post a Comment