Writing out lengthy commands (like database) every time you use them can be a pain.
Here, the alias command, which shortens lengthy commands to just a single word, comes in handy.
For instance, in Salesforce, to open a specific organisation in the browser, we use the following command:
|
|
We can shorten this command into one word, like “browse,” as below.
|
|
If you add the above command to your terminal and then the type the below command, it’s effectively the same as the long command.
|
|
To make these changes permanent, we need to add them to the /.zshrc file.
|
|
Switch to insert mode (:i) in vi and add the same alias command, to the file
|
|
Use (:wq) to save the file and quit.
To activate these changes, either open the terminal or, in the same window, use the source command as follows:
|
|
Now in this window or any new tab you can use the alias.