Command Tab Completion You May Be Unaware

I don’t know when it started since I found this by accident several years ago.

Command completion has been taken to extremes in a lot of common terminal applications. I find the best way to find them is just test it out on a command and see what you get.

A good example is the apt command. Here’s how it goes…

Just type this. You must have a space following apt:

me@host:~$ sudo apt 

Now, press the Tab key twice and viola!..

me@host:~$ sudo apt (press Tab Tab here)
autoclean     clean         edit-sources  list          rdepends      showsrc       
autoremove    depends       full-upgrade  moo           remove        source        
build-dep     dist-upgrade  help          policy        search        update        
changelog     download      install       purge         show          upgrade       
me@host:~$ sudo apt 

It’s all the accepted commands of the apt command! And just like most tab completion you can type the first character(s) and whittle it down, too.

But in the case of the apt command it gets better. Look at what happens with this one:

me@host:~$ sudo apt install (press Tab Tab here)
Display all 54304 possibilities? (y or n)

Yep, that’s all your packages! Type Y at you own risk. It’s better to whittle this one down a bit. :grinning:

Like I said, test it on your most used terminal commands and if you can, praise the developers for this little gem while you’re at it. :slight_smile:

8 Likes

Should be ‘press’ instead of type, so no one would get confused :dizzy_face: hehe

1 Like

How about “depress”? If someone says invalid, demonstrate with “you’re a very ugly Tab key!” :smirk:

Done.

Wow… That’s some good command line lurve. Thanks for sharing it! :thumbsup:

1 Like

:smile_cat: I’m just typing but this message is just the emoticon, so forget bout the text as I have to obey the 20 characters rule, I repeat, forget all I write on this post, jut read the emoticon.

TL;DR; just look at the emoticon. LOL

1 Like