SSH Hostname Autocompletion

SSH Hostname Autocompletion

Do you use SSH quite a bit, and grow tired of typing in the machine names each time?

There's an easy fix for that.

First, create a text file in your home directory called "hostfile". Populate it with a list of hosts, prepended by (a bogus IP address.) For instance:

Next, add the following line to the bottom of your .bashrc file. Now, the .bashrc file is hidden by default, so if you are browsing to find it you'll need to pick "Show Hidden Files" from the View menu of your file browser.

export HOSTFILE="/home/tony/hostfile"
Obviously replace my name with your home directory name. Now, you can type "ssh l" and it will automatically suggest ""! Quick and easy!
Posted by Tony on May 14, 2013 | Linux Tricks