July 16, 2008

Ten Handy Bash Aliases for Linux Users [Linux Tip]

TechRepublic's 10 Things blog posts 10 shortcut ideas for Linux
users (and Terminal-friendly OS X hackers) to make the terminal a
friendlier, faster place to work. To use them, open up the .bashrc
file found in your home directory and add lines in the following manner:

Alias NICKNAME='full command here'
Replace
"NICKNAME" with a quick-type command, and put the full command in
quotes. One example offered up by TechRepublic is a command to open up
a file you regularly edit, like your /etc/apt/sources.list repository list, with a single command:
For
instance, when I used Enlightenment E16 (I now use E17), I was
frequently editing the menu file ~/e16/menus/user_apps. Instead of
constantly opening up a terminal and entering nano
~/.e16/menus/user_apps, I used an alias that allowed me to type emenu
and start editing. I used this alias:

alias emenu='aterm nano -e ~/.e16/menus/user_apps'

Now, I just enter the command emenu (or I can enter that in the run command dialog) to open up this file in an editor.

Users of GNOME-based distributions like Ubuntu might want to switch gedit in place of nano -e
for an easier-to-grasp graphical editor. Got your own bash shortcuts
you put in every new Linux install? Share them in the comments.

No comments:

Post a Comment