How to create command aliases in linux?
For example, I'd like to make alias for ssh root@host
Thank you?
How to create command aliases in linux?
For example, I'd like to make alias for ssh root@host
Thank you?
Which shell?
Assuming bash, put this kind of thing in your .bashrc
:
alias srhost="ssh root@host"
I like to create a .bash_aliases file for portability between my systems I use. add this to your .bashrc
if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi
you can then add aliases to this file such as
alias psg='ps -auxww|grep'
also after adding a alias you will need to exit/open your terminal so the changes will take affect.
OR try
source ~/.bashrc
Only for your user, edit your .bashrc
alias srhost="ssh root@host"
To add Alias
alias newcommand="yourcommand -arguments"
To remove Alias
unalias newcommand