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.
alias command line
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:

  1. Open terminal Ctrl+Alt+T
  2. Enter "sudo nano ~/.bashrc"
  3. Add your code in new line in the last.
  4. Exit and save (Ctrl+X)
  5. Enter "source ~/.bashrc"

Removing alias:

The following command will remove "rename" alias
  • "unalias rename"

Comments

Popular posts from this blog

best 10 exchange languages websites for learners

مصادر تساعدك في تعلم الانجليزية للمبتدئين | بالعربي