FreeGeek.org Ubuntu spurns Microsoft’s advances: My Thoughts
Feb 19

I’ve found that the extended tab-complete functionality in Ubuntu is a major timesaver. I do a LOT of SSHing from machine to machine in my house as well as to machines out there on the Internet. I use my ~/.ssh/config file to set up easy-to-remember names for these machines and then use the command line to connect. For example, to connect to my Anapnea.net shell account, I have a block in my config file that looks like this:

host anapnea
hostname anapnea.net
user fakeusername
identityfile ~/.ssh/id

When I want to log in, I open my terminal program of choice and enter ssh ana<tab> and press enter. Pressing tab expands to anapnea and I make my connection saving 4 keystrokes.

Note: For those interested, SSH tab-complete will expand to the value of host or hostname. That’s handy if you can remember the actual hostname of the machine and you’ve forgotten what you entered as the value of host (yeah, I’ve done it). If that makes no sense to you, you can get more information on SSH config files with man 5 ssh_config.

Tab complete also works with lftp and some other programs when using Ubuntu. I’ve found the lack of it in Fedora a little frustrating (I keep pressing tab and get nothing). I did a little Googling to find out just what program sets up this functionality and checked the Fedora repos for it. Thankfully it can be found in all it’s glory and awaiting installation in Fedora extras.

su -c 'yum install bash-completion'

A few seconds later, you’re ready to bank your keystrokes and tab complete to your heart’s content.

Note: Any terminal sessions that were open when you installed the package won’t utilize it until you either restart the session or enter bash at the prompt. It seems that your shell needs to source the newly created /etc/profile.d/bash_completion.sh script. This is done when you invoke BASH by opening a terminal prompt or executing bash at the command line.

written by M@ \\ tags: , , , , ,

One Response to “SSH Tab Completion in Fedora Core 6”

  1. connection - somdaj.com » SSH Tab Completion in Fedora Core 6 Says:

    [...] post by Linux Neophyte and software by Elliott Back [...]

Leave a Reply