March 21, 2010
Host Completion in bash
![]() |
bash has programmable parameter completion, so you could set hostname completion up by coding it yourself. That's not necessary, though. Instead, you can pick up the bash completion files (also available as the bash-completion package in RH, Debian and from Darwin Ports for Mac OS X).
Once you've installed that, type:
. /etc/bash_completion |
|
Recent Tips » More Fun With ssh » Keeping Your ssh Connection Alive » 3 Apache/httpd Command-Line Options Read All Tips of the Trade |
This takes information from your .ssh/known_hosts file. It works automatically for ssh and similar commands, but you can also set other commands to use it. For example, maybe you have a script called 'update' which updates a particular host. Type:
complete -F _known_hosts update |
To investigate programmable completion options more, complete -p will list all the currently available completions.
Networking Solutions
- 1 Linux Server Management Nightmare: Attack of the Killer Penguins
- 2 Top 10 Open-Source Server Technologies You Need to Know
- 3 10 Coolest Features in Windows Server 2008
- 4 Getting Started With EFT Server -- A More Secure FTP Server Option
- 5 Making Linux Server Directories More Readable, Add to Perl's @INC Array




Windows Server 2008 R2 provides enhanced management control over resources across the enterprise. Downlaod this PDF to learn more.