Home Tutorials IT Jobs Source Codes Certifications Discussion Forum
  Linux Tutorial
Linux Introduction
Unix
Linus and Linux
What Kernel Is?
Linux Commands
Linux Shell
Root and Other Users
Virtual Consoles
Logoff and Shutdown
The Command Prompt
Wildcards
Command History
Aliases
Redirection
Pipelines
Stopping a Program
Environment Variables
Exit Status
Linux File System
Linux File Names
Linux Directories
Directory Terminology
Navigating the File System
Listing Linux Files
Linux Downloads
Recommended Books
   IT Jobs
Software Jobs
Networking Jobs
   Model Question Papers
BE Computer Science
MCA
BCA
Others
 
   

Linux Aliases

Aliases: Create Meaningful Synonyms for Commands

Defining an alias is another way to minimize your work at the keyboard, and you can also eliminate the need to remember long, awkward commands by creating synonyms that are more meaningful to you. Here are some examples:

alias dir='ls -l'
alias dogs='find . -name "*dog*" -print'

In this example, the first alias tells bash that when you enter dir on the command line, it should actually execute the ls -l command instead. If you're a hard-core DOS user, you could use alias to create DOS-like synonyms for many Linux commands.

The second alias lets you enter dogs instead of that long, ugly find command shown above. Don't worry about the ls and find commands right now. Just keep in mind that the alias command can save you some keystrokes and make it easier to remember a command.

Undoubtedly you will find other clever things to do with the alias command and add them to your .profile file so they will be available each time you log in. Your .profile file contains a series of comm ands that bash executes automatically when you log in, similar to autoexec.bat the DOS world.

For more information on alias click here

<< Previous | Next >>

Home  |  About us  | Privacy  |  Disclaimer  |  Contact us |  Advertise with us | Our Link Partners
All Rights Reserved 2009, CodeTeller.com