If you have used UNIX for a while, you will know that there are many commands available and that some of them have very cryptic names and/or can be invoked with a truckload of options and arguments. So, it would be nice to have a feature allowing you to rename these commands or type something simple instead of a list of options. Bash provides such a feature : the alias .
Aliasses can be defined on the command line, in .bash_profile, or in .bashrc, using this form :
| |
- alias ls='ls -aF --color=always'
- alias ll='ls -l'
- alias search=grep
- alias mcd='mount /mnt/cdrom'
- alias ucd='umount /mnt/cdrom'
- alias mc='mc -c'
- alias ..='cd ..'
- alias ...='cd ../..'
- alias ls='/bin/ls -aFG'
One more important thing. After you have added alias in .bashrc, you need to inform your system about the changes and hence execute the following command:
- source .bashrc

No comments:
Post a Comment