Can I make Tab auto-completion case-insensitive in the terminal?

1

Open a terminal, run

# If ~./inputrc doesn't exist yet, first include the original /etc/inputrc so we don't override it if [ ! -a ~/.inputrc ]; then echo '$include /etc/inputrc' > ~/.inputrc; fi # Add option to ~/.inputrc to enable case-insensitive tab completion echo 'set completion-ignore-case On' >> ~/.inputrc

Start a new shell / terminal.

to make this change for all users, edit /etc/inputrc

For details, see man bash . Yes it is a long page, but bash is a somewhat complex program, and if you want just search that page for "case-insensitive" to go to the relevant section. People usually learn bash one option at a time or one bash script at a time and it takes a long time to master all the nuances. Your interest may...

0 0
2

Using the Linux terminal is a fantastic thing. It gives you access to hundreds of great commands and programs, can make navigating through complex directories quick and easy, and offers tools like tab auto-complete that make doing all this a breeze. However, there is a caveat for some people: Linux is case-sensitive. Personally, I love how Linux is case-sensitive, but I know that not everyone will agree with me.

There are ways to create case-insensitive partitions, but doing this has its own technical and functional limitations. If anyone is interested, drop me a line, and I’ll work on a post on this topic.

For those that don’t like how everything in Terminal is case-sensitive, there is a solution that will relieve some of the pain. You can configure your system to make tab auto-complete case-insensitive even on a case-sensitive file system.

Before detailing how to make the change, I do have to make sure that you understand that this is a system-wide setting...

0 0
3

An annoying thing with the Mac terminal is that, out of the box, the tab completion* is case sensitive. Perhaps in linux land this is ok because most things are kept lower case. But, many default folders in Mac Os X start with upper-case letters (Desktop, Pictures, Public, etc). So, to turn off the case-sensitive completion, simply type this on the command line:

> echo "set completion-ignore-case On" >> ~/.inputrc

Be sure to start a new terminal instance for the changes to take effect.

* (Tab completion is when you start typing a folder or file in the terminal/console and hit tab, it auto completes to any matches it finds. Very handy and if you don't already use it, you should!)

Unlimited Domain Hosting Only $9.95 a...

0 0
4
Short answer no... Linux is a case sensitive OS

demonstration in point...

Microsoft are using a windows server.... let's jumble the caps a little...

http://www.microsoft.com/en/us/dEfAUlt.aspx

as you can see even though we've recapped a few of the littlers in default.aspx

it still finds the file, that's because to windows fIlE.txt is no different from file.txt or FILE.TXT.... Windows simply can't tell the difference...

Let's try Ubuntu.com which is hosted on a Linux server

http://www.ubuntu.com/products/whati...ures/iNdEx.php

as you see... it can't find the file because iNdEx.php is not index.php, Linux can tell the difference.....

In this case you could use url rewriting so that it redirects you to index.php.... but it comes down to Linux is a case sensitive operating system, while Windows isn't...

and while you could use regex to match you, it's a lot easier in the long run just to accept that Linux is not...

0 0
5

Restructured with the benefit of hindsight to contrast the pros and cons of using [.]inputrc vs. .bash_profile.
Tip of the hat to underscore_d for his help.

Note: Command-line editing in Bash is provided by the Readline library; customizing it is non-trivial, but well worth learning; its features include the ability to define custom keyboard shortcuts for inserting predefined snippets of text - see Command Line Editing in the Bash Reference Manual

To persistently make tab-completion case-insensitive in Bash:

Option A: If you either already have:

you're planning to customize the readline library extensively and/or want to make customizations effective for scripts too when they call read -e:

Add line

set completion-ignore-case on

to either file, depending on whether you want the setting to be effective for all users or the current user (create the file, if necessary).

A related command that makes completion of file and directory...

0 0
6

Ubuntu's Terminal uses case-sensitive auto-completion, as I suppose would be expected for Linux.

But I think it would often be more convenient to use a case-insensitive one instead, to save you having to be accurate while starting a name, and would probably be worth the extra false positives. Is it possible to change this behaviour?

Open a terminal, run

# If ~./inputrc doesn't exist yet, first include the original /etc/inputrc so we don't override it if [ ! -a ~/.inputrc ]; then echo '$include /etc/inputrc' > ~/.inputrc; fi # Add option to ~/.inputrc to enable case-insensitive tab completion echo 'set completion-ignore-case On' >> ~/.inputrc

Start a new shell / terminal.

to make this change for all users, edit /etc/inputrc

For details, see man bash . Yes it is a long page, but bash is a somewhat complex program, and if you want just search that page for "case-insensitive" to go to the relevant section. People usually learn bash one option at a...

0 0
7

I can't seem to get case-insensitive completion when usingTerm::ReadLine::Gnu. Take this example script:

use strict; use warnings; use 5.010; use Term::ReadLine; my $term = Term::ReadLine->new('test'); say "Using " . $term->ReadLine; if (my $attr = $term->Attribs) { $term->ornaments(0); $attr->{basic_word_break_characters} = ". \t\n"; $attr->{completer_word_break_characters} = " \t\n"; $attr->{completion_function} = \&complete_word; } # end if attributes my @words = qw(apple approve Adam America UPPER UPPERCASE UNUSED); sub complete_word { my ($text, $line, $start) = @_; return grep(/^$text/i, @words); } # end complete_word while (1) { $_ = $term->readline(']'); last unless /\S/; # quit on empty input } # end while 1

Note thatcomplete_worddoes case-insensitive matching. If I run this withTerm::ReadLine::Perl(by doingPERL_RL=Perl perl script.pl) it works as I expect. Typingalists all 4 words. TypinguconvertsutoUand lists 3 words.

When I...

0 0
8
...
0 0
9

This tutorial is designed to help people get up to speed quickly with building mainstream desktop graphical user interfaces with Tk, and in particular Tk 8.5, which is an incredibly significant milestone release and a significant departure from the older versions of Tk which most people know and love recognize.

The downside is that unless you know one or two particular things, it's actually not that significant a release; For backwards compatibility reasons, unless existing programs make a few simple changes, they won't look all that much different. So while this tutorial will certainly benefit newcomers to Tk, it will also help existing Tk developers bring their knowledge right up to date. It's a cliche, but I can't believe how much I've learned in writing this tutorial, and I've been using Tk for over fifteen years.

The general state of Tk documentation (outside the Tcl-oriented reference documentation, which is excellent) is unfortunately not at a high point these...

0 0