#alias
Eg.#alias dir="ls"
When we create the alias, the original command will still work.
Simply typing alias will list all the created aliases. To remove alias type:
unalias dirTo remove all aliases type:
unalias -aUsing the command alias will create alias for only current session & current user. Once you log off, all your aliases will be reset.
To create permanent aliases, you have to append the file .bashrc in the user directory (for root -> /root/.bashrc ; for other users -> /home/user/.bashrc). System-wide aliases can be put in the /etc/bashrc file. The system needs to be restarted before system-wide aliases can take effect.
Go to the directory of user & type 'ls -a' to see hidden files. Note that file name starting with (.) are hidden in Linux.
Open the file in vi/gedit & type the new lines at the end of file like this:
alias internet='sudo ifconfig' alias p='pwd' alias install='sudo apt-get -y install' alias remove='sudo apt-get -y remove'Likewise, you can add some more aliases.
No comments:
Post a Comment