CLI Magic: Bash complete (Linux.com)
CLI Magic: Bash complete (Linux.com)
Posted May 9, 2006 13:52 UTC (Tue) by Richard_J_Neill (subscriber, #23093)Parent article: CLI Magic: Bash complete (Linux.com)
In most distros, bash just beeps at you when you have more than one option for completion. This is unhelpful, and leads to people turning off the system bell. Much better is to have it print the options:
Edit ~/.inputrc and add:
set show-all-if-ambiguous on
Mandriva is the only distro I have tried that gets this right. It's far more helpful. And the system-bell is then meaningful on the occasions when it is used. (Redhat,Debian,Ubuntu get it 'wrong').
if using Konsole, you probably want to use the System Bell (= pcspkr) rather than System Notification (= arts)
Posted May 9, 2006 14:48 UTC (Tue)
by sholden (guest, #7881)
[Link] (5 responses)
Of course I also have directories with tens of thousands of files in them (over NFS) and you might as well go make some coffee if you double tab in one of those...
Posted May 9, 2006 16:36 UTC (Tue)
by Richard_J_Neill (subscriber, #23093)
[Link] (4 responses)
Ah. Bash is smarter than that! It will ask you for confirmation before trying to print out more than about 100 completions.
Add the bash-completion package, and you can even complete on PIDs, signals, Hostnames,Variables, package-names....
Eg: urpmi moz[TAB] -> illa
Posted May 9, 2006 16:59 UTC (Tue)
by jhardin@impsec.org (guest, #15045)
[Link] (3 responses)
Posted May 9, 2006 17:18 UTC (Tue)
by iabervon (subscriber, #722)
[Link] (2 responses)
Posted May 10, 2006 14:20 UTC (Wed)
by tjc (guest, #137)
[Link] (1 responses)
Posted May 12, 2006 12:06 UTC (Fri)
by nix (subscriber, #2304)
[Link]
Posted May 9, 2006 15:59 UTC (Tue)
by afalko (guest, #37028)
[Link] (1 responses)
Posted May 9, 2006 22:07 UTC (Tue)
by NapalmLlama (guest, #26327)
[Link]
I'm on Gentoo and if I turn the bell on BASH beeps at me all the time...
I like the beep - just press tab again to get the list of all the matches.CLI Magic: Bash complete (Linux.com)
> Of course I also have directories with tens of thousands of files in them > (over NFS) and you might as well go make some coffee if you double tab in > one of those...CLI Magic: Bash complete (Linux.com)
killall mpl[TAB] -> ayer
ping lo[TAB] -> calhost
...I know I've using tab completion too much when logging in I automatically type "jha[TAB]"CLI Magic: Bash complete (Linux.com)
You really know you're in trouble when you try to tab-complete while making out a check. Of course, I personally tend more towards trying to cut-and-paste from my computer to a piece of paper or back.CLI Magic: Bash complete (Linux.com)
I have to admit to once trying to open the front door of my house with the remote keyless entry fob for my car. :-/
CLI Magic: Bash complete (Linux.com)
I'm always trying to open my house's front door with my train ticket, and do SecureID authentication with my iPod (hey, it's sort of the same shape and size, i.e., rectangularish, and smaller than a brick).CLI Magic: Bash complete (Linux.com)
Gentoo gets it right too.CLI Magic: Bash complete (Linux.com)
How so?CLI Magic: Bash complete (Linux.com)