Wednesday, September 8, 2010

Command Line Aliases (UbuntuLinux)



Great tip for creating aliases for common command line instructions in UbuntuLinux at OMGUbuntu!

Add the following ‘aliases’ to the ‘bashrc’ file in your home folder. You can locate this by pressing CTRL + H when in your home folder and seeking out ‘.bashrc’ (note the period)
alias install=’sudo apt-get -y install’
alias search=’apt-cache search’
alias purge=’sudo apt-get purge’
Now you can use the following simple commands in the terminal, using ‘sudo’ where applicable.
To search for a package: search rhythmbox
To install a package: install rhythmbox
To purge a package: purge rhythmbox
So, now my .bashrc file has a section for aliases that looks like this:
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias install=’sudo apt-get -y install’
alias search=’apt-cache search’
alias purge=’sudo apt-get purge’
Neat tip. The challenge is trying to remember the original command, make up a variant and then add it to the alias!

Update 12/2010: After trying this out, it didn't work for me. Too bad. I ended up removing it.

Subscribe to Around the Corner-MGuhlin.org


Everything posted on Miguel Guhlin's blogs/wikis are his personal opinion and do not necessarily represent the views of his employer(s) or its clients. Read Full Disclosure

No comments:

The Courage to Lead