Tuesday, March 3, 2009

About Alias

alias allows you to define shortcuts and synonyms for commonly used shell commands.

The basic usage is:

alias newcommand='yourcommand -arguments'

If you want to start aterm according to your preferences with the command term, do something like:

alias term='aterm -ls -fg gray -bg black'

If you want a quick alias like ll for a more informative file listing:

ls -al --color=yes

Starting alias without any options lists the current aliases:

alias

alias ls='ll'
alias ls -al --color=yes
alias term='aterm -ls -fg gray -bg black'

Use unalias to remove an alias.

About alias

Commonly used for a long strings that are frequently used. Alias allows you to have a small more familiar command or name to execute a long string.

Syntax

alias [name=['command']]
name Specifies the alias name.
command Specifies the command the name should be an alias for.
-a Removes all alias definitions from the current shell execution environment.
-t Sets and lists tracked aliases.
-x Sets or prints exported aliases. An exported alias is defined for scripts invoked by name.

Examples

alias home 'cd public_html' - Sets home to type cd public_html

to remove this alias use the unalias command

We recommend that ISP's or Unix systems with users who may be unfamiliar with Unix setup the following aliases:

clr clear
cls clear
copy cp -i
del rm -i
delete rm -i
dir ls -alg
home cd ~
ls ls -F
md mkdir
move mv -i
pwd echo $cwd
type more

sources:
http://linuxreviews.org/quicktips/alias/
http://www.computerhope.com/unix/ualias.htm

No comments:

Blog Archive