Thursday, 14 May 2015

Creating Short command for terminal in Ubuntu


1. Open terminal (ctrl+alt+T)
2. Open bashrc file in your favorite editor :=> vim ~/.bashrc
3. add line :=> alias <short_command>='<long_command>'
ex. : alias s220='ssh test@192.168.0.220'



If you want to pass password also, you have to install "sshpass" by following commands
1. sudo apt-get install sshpass

Now you can use short command like
alias s220='sshpass -p your_password ssh user@hostname'


No comments:

Post a Comment