TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Reverse Tab Completion

2 pointsby lucasgonzeabout 6 years ago
Is it possible to get reverse tab completion, so that you type the last characters in the filename you want, press tab (or whatever the reverse keystroke is), and get the full file name?<p>Sometimes I have files where the unique bit is at the end, and tab completion is useless for them. For example with these ---<p>version1.txt version2.txt version3.txt<p>--- I&#x27;d have to type out &quot;version&quot; before hitting tab, and what I&#x27;d like is to type 1.txt, hit tab, and have &quot;version&quot; prepended.

1 comment

ktpsnsabout 6 years ago
Shells like bash do wildcard expansion on tab keystroke. So you type<p><pre><code> cat version*.txt </code></pre> then tab and it expands that into<p><pre><code> cat version1.txt version2.txt version3.txt </code></pre> The same is of course true with any other kind of wildcard like<p><pre><code> *.tar.gz </code></pre> (is that what you mean with reverse tab completion?) And even ranges like &quot;version{1..3}&quot; and much more. Look up <a href="http:&#x2F;&#x2F;bash-hackers.org" rel="nofollow">http:&#x2F;&#x2F;bash-hackers.org</a>, the ultimate guide for shell globbing and other bash features.