Sick of typing out long commands, bad at typing, forget commands from time to time or all 3 like me… then aliases are here to help.
Basically, you can use a handy short memorable alias for a long and possible complicated one in terminal by doing the following.
Open terminal, go to root ( cd ~/ ) and see if a file under the name .bash_login exists… if not create it.
Open this file in vim, enter your aliases like so…
alias dev1=’ssh firstname.lastname@example.org’
alias dev2=’ssh email@example.com’
So now each time I enter dev1 into the terminal, I will be ssh’ing into my server, or dev2 to ssh into another one without having to recall the hostname and such… sweet.
You can add as many as you like for any command.
HANDY TIP: Enter the alias !=history and now you each time you type ! plus some text, the terminal will figure out which command to call based on your terminal history and the text you entered.
HANDY TIP #2: Use CTRL+R to search through any of your previous commands, you can insert any part of the command… super!