Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Here's an example of what I mean:

In my home dir, I have three directories starting with "work":

$ ls | grep ork
WorkProjects
workspace
workspacepython

Notice that "WorkProjects" starts with a capital W.

Now, I want to cd into one of them. I typically type "cd work" followed by TAB. Resulting in:

$ cd work
WorkProjects/     workspace/        workspacepython/

Where the first entry is the folder starting with the capital W. I want it to sort it according to best match first, e.g. folders actually starting with "work" case-sensitive first, and then any case-insensitive matches.

Wanted result:

$ cd work
workspace/        workspacepython/     WorkProjects/

Is this possible to change somewhere?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I'm afraid the answer to your question is:

  • yes it is possible,
  • btw that is the default behavior
  • so you'll have to check your shell configuration.

try using this:

% zsh -f # starts new shell ignoring all your configuration options
% autoload compinit && compinit # starts the completion system
% cd /tmp && mkdir test && cd test && mkdir work Work wooork
% cd w[TAB]
wooork/ work/    Work/

You'll notice it will list work before it lists Work.

PS: did you notice your shell prompt character is $? Are you using zsh or bash?

share|improve this answer
    
Yes, you're quite right. It is the default behavior. This actually stems from "oh-my-zsh" which I've been using as well. And in there there is a simple option of case-sensitivity which I had missed. Thanks! –  Jonas Kalderstam Apr 10 at 13:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.