FACTOID # 167: Like living in cities? Guadeloupe, Nauru, Monaco, Singapore, Gibraltar and Bermuda are only nations that are 100% urbanised.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Alias (Unix shell)

In Unix shells (like csh, bash, etc.), alias is a command that enables a replacement of a word with another string. It's mainly used for abbreviating a system command, or for adding default arguments to a command which one regularly uses. For example: A Unix shell, also called the command line, provides the traditional user interface for the Unix operating system. ... CSH is a three-letter abbreviation with multiple meanings: The United States Army operates combat support hospitals. ... Bash is a Unix shell written for the GNU Project. ...

 alias xx="ls -l" 

would enable one to type xx to do ls -l. This would last while the current shell was active and would not work in another shell or another session. Regularly used aliases could be placed in the shell's configuration file (~/.cshrc or the systemwide /etc/csh.cshrc for csh, or ~/.bashrc or the systemwide /etc/bashrc for bash) etc., to run them at login or shell startup.


For more permanent replacement that is independent of the shell, one might use a symbolic link rather than an alias: In computing, a symbolic link (often shortened to symlink) is a special type of file that serves as a reference to another file. ...

 ln -s /usr/bin/fullcommandname /usr/bin/shortercommand 

Or without root access:

 ln -s /usr/bin/somecommandlong ~/bin/shortcmd 

Aliases cannot do more sophisticated stuff like taking arguments, etc. For that, most shells support functions instead.


Typical aliases (from bash):

 alias ls='ls --color=tty' # use colors alias la='ls -a' alias ll='ls -l' 
 alias rm='rm -i' # prompt before overwrite alias cp='cp -i' alias mv='mv -i' 
 alias vi='vim' # use improved vi editor 

Anonymous Aliases


With anonymous aliases it's possible to use a command as it was meant originally defined, even if an alias with extra arguments exists for that command. For instance, if the following alias definition is set

 alias ls='ls -la' 

We can still use "ls" as a no extra arguments command. In order to do so, just put the command without arguments as follow:

 'ls' 

  Results from FactBites:
 
Alias - Wikipedia, the free encyclopedia (182 words)
Look up alias and aliasing in Wiktionary, the free dictionary.
Alias Systems Corporation, the software company that produces Maya.
Alias, the pseudonym of a rap artist who founded and records for Anticon.
Appendix B: Bash Shell Tips (704 words)
Bash is the default UNIX shell for RCS.
A UNIX ``shell" is a program that acts as the interface between you and the UNIX operating system, prompting you for input, checking commands for syntax errors and, then executing them.
Bash, which stands for the Bourne-Again Shell, was chosen because it incorporates many popular features of other shell programs, such as the Bourne shell (sh), the C shell (csh), and the Korn shell (ksh).
  More results at FactBites »


 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m