Unix How-To: Time-Saving Aliases

By  

This alias lets you type "up" when you want to go up one level in the file system -- a 60% reduction in typing over the standard "cd ..".

alias up="cd .."

And for anyone who frequently logs into other systems, especially if they need to switch usernames in the process, aliases like this (one for each target system) can save them a little time and annoyance.

alias server_name='ssh 10.20.30.40 -l myself'

If you use a bunch of aliases and want to see how a particular alias is defined, you can get a listing with the alias command itself. Just type alias followed by the name of the particular alias.

$ alias up
alias up='cd ..'

If you sell your users on a nice collection of aliases, you might also want to tell them how to turn them off when they don't want the particular behavior.

unalias ls

Sometimes you can make a Unix user happy just by giving him a tool that saves him a little time. Sometimes the time you save may be your own. But good use of aliases can always make a day's work feel a little less tedious.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

ITworld Answers helps you solve problems and share expertise. Ask a question or take a crack at answering the new questions below.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question