I want to create a shortcut for a command in terminal. Like for a command "ssh firstname.lastname@example.org", I just want a command "user" and the above command will run. Is this possible, and if so how can it be done?
Aliases can take parameters. For example:
will perform chmod recursively on
Generally the answer is to alias your command, as mentioned by M.Tarun. For your example with ssh you might want to add it to your
Then call ssh with the name:
Your shell probably also has tab-completion for ssh. So you can just type
This also has the advantage that it works with other commands like
Whereas the alias approach would not work with this.
The shortcuts for commands are known as aliases.
So to create an alias for your command open the termianl and type: