Q. What is a shell alias and how do I use them under Linux?
A. An alias is nothing but a short form of a Linux or UNIX command. You use aliases to save the time. To create an alias use the alias command.
Task: Display current aliases
Type alias command with no arguments or with the -p option prints the list
of aliases in the form alias NAME=VALUE on screen:
$ alias
Output:
alias cp='cp -i' alias l.='ls -d .* --color=tty' alias ll='ls -l --color=tty' alias ls='ls --color=tty' alias mv='mv -i' alias rm='rm -i' alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
Task : Create an alias
To create an alias use the alias command as follows:
$ alias c=’clear’
Now, type c and hit enter key to run clear the screen aka run screen command.
Task : Remove or delete an alias
To remove or delete an alias use
$ unalias c
Verify that an alias deleted:
$ alias
See also:
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 1 comment… read it below or add one }
Vivek,
it may be a WORDPRESS bug,
but check line AFTER “To create an alias use the alias command as follows:”
It contains wrong characters instead of single quotes, surrounding the word [ clear ]