How to create alias command to customize your own command line
alias command is a simple and useful command, allows you to customize or short your command lines.
Terminal interface |
The following lines will explain how to use alias command with examples
The type of alias syntax in short:
- alias name="value"
name: the naming of the code that you will call the line by this name.
value: the command that will enter when calling the name, written between two quotation marks"".
Examples:
- alias dir="ls"
- alias copy="cp"
- alias rename="mv"
- alias md="mkdir"
- alias server='ssh asil@192.168.1.4"
- alias offer="cd && cd Downloads && gedit offer.txt ; cd"
How to create an alias:
- Open terminal Ctrl+Alt+T
- Enter "sudo nano ~/.bashrc"
- Add your code in new line in the last.
- Exit and save (Ctrl+X)
- Enter "source ~/.bashrc"
Removing alias:
The following command will remove "rename" alias
- "unalias rename"
Comments
Post a Comment