An introduction to bash completion: part 1
Posted by Steve on Fri 23 Dec 2005 at 09:34 Most shells allow command completion, typically bound to the TAB key, which allow you to complete the names of commands stored upon your PATH, file names, or directory names. This is typically used like so: ls /bo[TAB] /boot . Recently some shells have started allowing you to do even more: completing arguments to commands. Two notable shells which allow this are zsh, and bash. Since I'm a bash user I'm only going to cover that. The Debian bash package supplies a command line completion file /etc/bash_completion which sets up some common support. If you're not using it right now you can load it by typing into your shell " . /etc/bash_completion " as shown here: skx@lappy:~$ . /etc/bash_completion skx@lappy:~$ Once this is done you'll be able to TAB-complete many common arguments to programs, for example: skx@lappy:~$ apt-get upd[TAB] skx@lappy:~$ apt-get upg[TAB] But how do you extend the support yourself?Read full article from An introduction to bash completion: part 1
No comments:
Post a Comment