Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Just hit 'tab' twice' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Just hit 'tab' twice
Authored by: wkoffel on Nov 12, '03 07:20:59PM

In my bash shell (ever since 10.1, I think), just hitting tab twice prompts to show me all programs.

This is standard Unix shell completion. What's going on is that hitting tab tries to complete whatever you've been typing. If there isn't a single matching completion, hitting it again will show the list of possible completions. If that list is over a certain length , it prompts you before spitting them all to the terminal.

So, as a few practical examples, if you want to find a decent subset of all the X11 applications you could run (they often start with the letter 'x', just by convention), type x[tab][tab]

This also works with completion not of applications, but of items in your directories. So let's say you were curious about how many of those X11 applications live in /usr/bin/, you could type

$ cd /usr/bin/
$ ls x[tab][tab]

for me, it yields:
$ ls x
xargs xml2-config xmllint xsubpp
xcodebuild xmlcatalog xstr xxd
$ ls x

tab completion in the shell becomes like breathing eventually. Less than half the commands I use do I ever type all the way out myself, and even fewer of the documents that I edit.

[ Reply to This | # ]
Just hit 'tab' twice
Authored by: wkoffel on Nov 12, '03 07:22:23PM

Oh, and if it's a competition, I'm at 2101 possible commands. I'm sure someone can beat that, though. :-)

[ Reply to This | # ]