Here's a quick tip on linux alias command, definitions and usage.
In Linux, an alias is basically used to duplicate a name or a command. Duplicating a linux alias or a linux command gives comfort and convinience in some reasons. There are lots of linux command that are hard to remember and too long to type in terminal. Others linux commands are seldomly used and not easy to remember. There are times that you frequently use the same command parameters and command options on issuing a particular command, linux command aliasing can be of benefit and helpful on these scenarios and cases.
More Alias Usage
If you wish to shortcut a certain command, we can use the same approach like the ones shown below:
~~~~~~~~~~~~~~~~~~~~~~~
# alias c='cat'
# c testfile.txt
~~~~~~~~~~~~~~~~~~~~~~~
From the above usage, issuing 'c' alone would be equivalent as issuing a cat command.
Another approach. Aliasing can be of handy on a scenario where in you frequently CD on a particular folder to update and check for some files upon your superior's request.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# alias goman=’cd /home/north/priority10/web-customers/wallstreet/www/public_html/admins
# goman
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Changing to a folder location of cd /home/north/priority10/web-customers/wallstreet/www/public_html/admins on frequent basis is now convenient using the alias goman as shown above.
Another alias example. If we always use ls command with -la parameter, aliasing it as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# alias lls=’ls -la’
# lls
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Issuing lls would be just fine to get the same command result.
Now, let us assume that nobody should use 'reboot' command
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# alias reboot='reboot command not found'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The next time a user executes reboot command, the user would be prompted that reboot command does not exist.
Note that these alias commands are only effective on current login sessions. In order to make it permanently, you need to edit and save it as user's .profile file located from user's home folder. A system wide alias can also be done and included to /etc/profile file.
Issuing alias without any parameter would list down all aliases aliased with alias.
In order to remove an existing session alias, you can use the unalias command.
For example , to remove an alias gogogo, simply
~~~~~~~~~~~~~~~~~~~~~
# unalias gogogo
~~~~~~~~~~~~~~~~~~~~~
Alternatively, you can remove the alias by modifying .profile or /etc/profile file(s).
Alias linux command is simple and get things done easier and faster. Saves more effort and time with your finger tips and tik-taks with the keyboard as well.
HTH
Subscription
Categories
- HowTos (612)
- Linux Devices (40)
- Linux Diggs (620)
- Linux News (1541)
- Linux Videos (24)
Recent Posts
Blog Archive
-
▼
2007
(340)
-
▼
December
(38)
- Holiday Linux
- HowTo: Chikka messenger over GAIM Pidgin Messenger
- HowTo: Rename Multiple Files Without A Script
- HowTo: KDocker/AllTray - System Tray Docking
- HowTo: Thunderbird - News/Feed Reader
- HowTo: ThinFeeder - RSS/RDF/Atom Aggregator
- HowTo: Sage - Firefox Feed Reader Extension
- HowTo: Snownews - RSS/RDF Newsreader
- HowTo: Planet - RDF/RSS/Atom Feed Aggregator
- HowTo: Liferea - RSS/RDF Feed Reader
- HowTo: Blam - RSS/RDF Feed Reader
- Switching Hospital Systems to Linux
- HowTo: CSS Editor and Validator Install
- HowTo: Ebook Reader Install
- vertito's blogspot anniversary
- HowTo: Install 113 Amazing Fedora Games Part 8
- HowTo: Install 113 Amazing Fedora Games Part 7
- HowTo: Install 113 Amazing Fedora Games Part 6
- HowTo: Install 113 Amazing Fedora Games Part 3
- HowTo: Install 113 Amazing Fedora Games Part 2
- HowTo: Thunar File Manager
- HowTo: LeafPad Extremely Fast Text File Editor
- HowTo: View Bzipped file On-The-Fly
- HowTo: TuxPaint Drawing Program Installation
- HowTo: InkScape Drawing Program Installation
- HowTo: Adobe Flash Player on Fedora 8
- HowTo: Install Digital Comic Reader
- HowTo: Install 113 Amazing Fedora Games
- HowTo: Translate Find Statements to Perl Codes
- HowTo: Single Step VirtualBox Installation on Fedo...
- CLI Tip: Control Terminal Keystroke Combinations
- CLI Tip: Clearing Terminal Screen
- HowTo: Linux Aliasing Aliases
- HowTo: Move Multiple Files Recursively
- HowTo: Rename multiple files recursively
- HowTo: Strip Non-Directory Path Suffix from FileName
- HowTo: Generate Pronounceable Random Passwords
- HowTo: Determine RedHat and Fedora release version
-
▼
December
(38)
Monday, December 3, 2007
HowTo: Linux Aliasing Aliases
Subscribe to:
Post Comments (Atom)
ILoveTux - howtos and news | About | Contact | TOS | Policy
0 comments:
Post a Comment