The 'alias' command let's you do just that. ;)
Say we want to alias a long ssh command that connects you to the production mail server and call it as 'mail.prod': 'ssh vincent@192.168.154.230 -i ~/.ssh/secret.pem'
Here we go:
- Create a file named ~/.bash_aliases
- Add an entry:
- alias mail.prod='ssh vincent@192.168.154.230 -i ~/.ssh/secret.pem'
- Bash doesn't have any idea of the command yet, you may want to re-open the terminal or execute the following to effect changes:
- source ~/.bash_aliases