Can I make Tab auto-completion case-insensitive in Bash?












125















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?










share|improve this question

























  • Very good question. As a usability tool, tab-completion should not be as strict as the computer system in general when it comes to naming things.

    – masterxilo
    Jan 23 at 8:55
















125















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?










share|improve this question

























  • Very good question. As a usability tool, tab-completion should not be as strict as the computer system in general when it comes to naming things.

    – masterxilo
    Jan 23 at 8:55














125












125








125


47






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?










share|improve this question
















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?







command-line bash auto-completion case-insensitive






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 28 at 11:50







mwfearnley

















asked Dec 12 '11 at 5:19









mwfearnleymwfearnley

99921020




99921020













  • Very good question. As a usability tool, tab-completion should not be as strict as the computer system in general when it comes to naming things.

    – masterxilo
    Jan 23 at 8:55



















  • Very good question. As a usability tool, tab-completion should not be as strict as the computer system in general when it comes to naming things.

    – masterxilo
    Jan 23 at 8:55

















Very good question. As a usability tool, tab-completion should not be as strict as the computer system in general when it comes to naming things.

– masterxilo
Jan 23 at 8:55





Very good question. As a usability tool, tab-completion should not be as strict as the computer system in general when it comes to naming things.

– masterxilo
Jan 23 at 8:55










4 Answers
4






active

oldest

votes


















149














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 vary.






share|improve this answer


























  • Thanks. I appreciate the user-specific/non-admin friendly solution. The echo line seems to have worked, but now I seem to have lost the ability to use Ctrl-Left/Right to move the cursor. Also, would >> be safer than >?

    – mwfearnley
    Dec 12 '11 at 6:27













  • In general >> is going to be safer, my mistake, I was assuming you did not have a ~/.inputrc . I also set noclobber =) Bit sure why your arrow keys are not working, I can not replicate that. You can remove ~/.inputrc and start a new shell.

    – Panther
    Dec 12 '11 at 6:30













  • Yeah, it works again if I remove it.. According to linuxfromscratch.org/blfs/view/5.1/postlfs/inputrc.html the new inputrc might be overriding the global one?

    – mwfearnley
    Dec 12 '11 at 7:00








  • 2





    Holy shit, I copied this into /etc/inputrc and I can't type "i" anymore and when I type "e" it just spams "ssssssssss[..]" into the console.. better use the solution from @emtin4

    – Luca Steeb
    Mar 31 '16 at 23:49






  • 1





    @LucaSteeb I hit that too, but then realized this whole block is not supposed to be put in your .inputrc, but typed once. Only $include /etc/inputrc and set completion-ignore-case on should be in your ~..inputrc file.

    – Chris
    Jan 8 '18 at 19:32



















44














Open a terminal and type the below command:



echo set completion-ignore-case on | sudo tee -a /etc/inputrc


Enter password. Restart terminal.



If in some case you want to remove case insensitive, just edit /etc/inputrc file by removing the set completion-ignore-case line.



That's all.






share|improve this answer


























  • OK, I clarified that for you. It takes a while to learn about bash, but keep exploring, reading, and asking. linuxcommand.org is a popular start ;)

    – Panther
    Dec 14 '11 at 16:46






  • 2





    In case there is more than one user, this changes it for all, which may or may not be the desired behavior

    – Walter Tross
    Jun 19 '15 at 17:35






  • 2





    by far the most straight forward and simplistic answer here

    – workabyte
    Jun 30 '16 at 21:31













  • simple and clear answer

    – Developerium
    Sep 2 '18 at 7:29



















9














I know this question is very old but unless I am missing something I think I have a super simple solution if you are using bash.



echo "bind 'set completion-ignore-case on'" >> ~/.bashrc


Or just add the line using your favorite text editor. Restart your bash session and enjoy.






share|improve this answer



















  • 1





    Well, you're missing something: ~/.inputrc is read by readline, which is what bash uses to provide this completion. Readline is also used by other programs, so, for generally setting this, ~/.inputrc as suggested the accepted answer would be better.

    – muru
    Jan 31 '16 at 2:50











  • Thanks for your suggestion, it teaches me a little more, but I have to say that it doesn't seem any simpler than the one I accepted, which just uses an additional line to ensure the new file doesn't nullify the old.

    – mwfearnley
    Feb 1 '16 at 20:52











  • perfect. well the only thing to remember is bind 'set completion-ignore-case on' should go in new line of .bashrc

    – Vishrant
    Aug 18 '18 at 23:20



















1














You can do this by setting a configuration variable for GNU readline, which is what handles the input in an interactive shell.



The variable needed is completion-ignore-case, and can be set directly in your bash session with:



bind "set completion-ignore-case on"


It can be enabled for all future bash sessions by putting it in the users's ~/.inputrc file, or the system /etc/inputrc, to enable it for all users. This is the initialisation file for readline.



But note that if you create ~/.inputrc, this will override the system copy. (For me this caused me to lose some key mappings, such as Ctrl-Left/Right. You can see which ones by perusing the /etc/inputrc file.)

The way to fix this problem is to put the line $include /etc/inputrc at the top of ~/.inputrc, e.g.:



$include /etc/inputrc

set completion-ignore-case on


To apply the changes, restart bash or reload inputrc, e.g. with Ctrl+x,Ctrl+r.



More information about readline and inputrc can be found in man bash and man 3 readline.






share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f87061%2fcan-i-make-tab-auto-completion-case-insensitive-in-bash%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    149














    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 vary.






    share|improve this answer


























    • Thanks. I appreciate the user-specific/non-admin friendly solution. The echo line seems to have worked, but now I seem to have lost the ability to use Ctrl-Left/Right to move the cursor. Also, would >> be safer than >?

      – mwfearnley
      Dec 12 '11 at 6:27













    • In general >> is going to be safer, my mistake, I was assuming you did not have a ~/.inputrc . I also set noclobber =) Bit sure why your arrow keys are not working, I can not replicate that. You can remove ~/.inputrc and start a new shell.

      – Panther
      Dec 12 '11 at 6:30













    • Yeah, it works again if I remove it.. According to linuxfromscratch.org/blfs/view/5.1/postlfs/inputrc.html the new inputrc might be overriding the global one?

      – mwfearnley
      Dec 12 '11 at 7:00








    • 2





      Holy shit, I copied this into /etc/inputrc and I can't type "i" anymore and when I type "e" it just spams "ssssssssss[..]" into the console.. better use the solution from @emtin4

      – Luca Steeb
      Mar 31 '16 at 23:49






    • 1





      @LucaSteeb I hit that too, but then realized this whole block is not supposed to be put in your .inputrc, but typed once. Only $include /etc/inputrc and set completion-ignore-case on should be in your ~..inputrc file.

      – Chris
      Jan 8 '18 at 19:32
















    149














    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 vary.






    share|improve this answer


























    • Thanks. I appreciate the user-specific/non-admin friendly solution. The echo line seems to have worked, but now I seem to have lost the ability to use Ctrl-Left/Right to move the cursor. Also, would >> be safer than >?

      – mwfearnley
      Dec 12 '11 at 6:27













    • In general >> is going to be safer, my mistake, I was assuming you did not have a ~/.inputrc . I also set noclobber =) Bit sure why your arrow keys are not working, I can not replicate that. You can remove ~/.inputrc and start a new shell.

      – Panther
      Dec 12 '11 at 6:30













    • Yeah, it works again if I remove it.. According to linuxfromscratch.org/blfs/view/5.1/postlfs/inputrc.html the new inputrc might be overriding the global one?

      – mwfearnley
      Dec 12 '11 at 7:00








    • 2





      Holy shit, I copied this into /etc/inputrc and I can't type "i" anymore and when I type "e" it just spams "ssssssssss[..]" into the console.. better use the solution from @emtin4

      – Luca Steeb
      Mar 31 '16 at 23:49






    • 1





      @LucaSteeb I hit that too, but then realized this whole block is not supposed to be put in your .inputrc, but typed once. Only $include /etc/inputrc and set completion-ignore-case on should be in your ~..inputrc file.

      – Chris
      Jan 8 '18 at 19:32














    149












    149








    149







    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 vary.






    share|improve this answer















    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 vary.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited May 22 '16 at 1:52









    muru

    1




    1










    answered Dec 12 '11 at 5:48









    PantherPanther

    79.1k14157259




    79.1k14157259













    • Thanks. I appreciate the user-specific/non-admin friendly solution. The echo line seems to have worked, but now I seem to have lost the ability to use Ctrl-Left/Right to move the cursor. Also, would >> be safer than >?

      – mwfearnley
      Dec 12 '11 at 6:27













    • In general >> is going to be safer, my mistake, I was assuming you did not have a ~/.inputrc . I also set noclobber =) Bit sure why your arrow keys are not working, I can not replicate that. You can remove ~/.inputrc and start a new shell.

      – Panther
      Dec 12 '11 at 6:30













    • Yeah, it works again if I remove it.. According to linuxfromscratch.org/blfs/view/5.1/postlfs/inputrc.html the new inputrc might be overriding the global one?

      – mwfearnley
      Dec 12 '11 at 7:00








    • 2





      Holy shit, I copied this into /etc/inputrc and I can't type "i" anymore and when I type "e" it just spams "ssssssssss[..]" into the console.. better use the solution from @emtin4

      – Luca Steeb
      Mar 31 '16 at 23:49






    • 1





      @LucaSteeb I hit that too, but then realized this whole block is not supposed to be put in your .inputrc, but typed once. Only $include /etc/inputrc and set completion-ignore-case on should be in your ~..inputrc file.

      – Chris
      Jan 8 '18 at 19:32



















    • Thanks. I appreciate the user-specific/non-admin friendly solution. The echo line seems to have worked, but now I seem to have lost the ability to use Ctrl-Left/Right to move the cursor. Also, would >> be safer than >?

      – mwfearnley
      Dec 12 '11 at 6:27













    • In general >> is going to be safer, my mistake, I was assuming you did not have a ~/.inputrc . I also set noclobber =) Bit sure why your arrow keys are not working, I can not replicate that. You can remove ~/.inputrc and start a new shell.

      – Panther
      Dec 12 '11 at 6:30













    • Yeah, it works again if I remove it.. According to linuxfromscratch.org/blfs/view/5.1/postlfs/inputrc.html the new inputrc might be overriding the global one?

      – mwfearnley
      Dec 12 '11 at 7:00








    • 2





      Holy shit, I copied this into /etc/inputrc and I can't type "i" anymore and when I type "e" it just spams "ssssssssss[..]" into the console.. better use the solution from @emtin4

      – Luca Steeb
      Mar 31 '16 at 23:49






    • 1





      @LucaSteeb I hit that too, but then realized this whole block is not supposed to be put in your .inputrc, but typed once. Only $include /etc/inputrc and set completion-ignore-case on should be in your ~..inputrc file.

      – Chris
      Jan 8 '18 at 19:32

















    Thanks. I appreciate the user-specific/non-admin friendly solution. The echo line seems to have worked, but now I seem to have lost the ability to use Ctrl-Left/Right to move the cursor. Also, would >> be safer than >?

    – mwfearnley
    Dec 12 '11 at 6:27







    Thanks. I appreciate the user-specific/non-admin friendly solution. The echo line seems to have worked, but now I seem to have lost the ability to use Ctrl-Left/Right to move the cursor. Also, would >> be safer than >?

    – mwfearnley
    Dec 12 '11 at 6:27















    In general >> is going to be safer, my mistake, I was assuming you did not have a ~/.inputrc . I also set noclobber =) Bit sure why your arrow keys are not working, I can not replicate that. You can remove ~/.inputrc and start a new shell.

    – Panther
    Dec 12 '11 at 6:30







    In general >> is going to be safer, my mistake, I was assuming you did not have a ~/.inputrc . I also set noclobber =) Bit sure why your arrow keys are not working, I can not replicate that. You can remove ~/.inputrc and start a new shell.

    – Panther
    Dec 12 '11 at 6:30















    Yeah, it works again if I remove it.. According to linuxfromscratch.org/blfs/view/5.1/postlfs/inputrc.html the new inputrc might be overriding the global one?

    – mwfearnley
    Dec 12 '11 at 7:00







    Yeah, it works again if I remove it.. According to linuxfromscratch.org/blfs/view/5.1/postlfs/inputrc.html the new inputrc might be overriding the global one?

    – mwfearnley
    Dec 12 '11 at 7:00






    2




    2





    Holy shit, I copied this into /etc/inputrc and I can't type "i" anymore and when I type "e" it just spams "ssssssssss[..]" into the console.. better use the solution from @emtin4

    – Luca Steeb
    Mar 31 '16 at 23:49





    Holy shit, I copied this into /etc/inputrc and I can't type "i" anymore and when I type "e" it just spams "ssssssssss[..]" into the console.. better use the solution from @emtin4

    – Luca Steeb
    Mar 31 '16 at 23:49




    1




    1





    @LucaSteeb I hit that too, but then realized this whole block is not supposed to be put in your .inputrc, but typed once. Only $include /etc/inputrc and set completion-ignore-case on should be in your ~..inputrc file.

    – Chris
    Jan 8 '18 at 19:32





    @LucaSteeb I hit that too, but then realized this whole block is not supposed to be put in your .inputrc, but typed once. Only $include /etc/inputrc and set completion-ignore-case on should be in your ~..inputrc file.

    – Chris
    Jan 8 '18 at 19:32













    44














    Open a terminal and type the below command:



    echo set completion-ignore-case on | sudo tee -a /etc/inputrc


    Enter password. Restart terminal.



    If in some case you want to remove case insensitive, just edit /etc/inputrc file by removing the set completion-ignore-case line.



    That's all.






    share|improve this answer


























    • OK, I clarified that for you. It takes a while to learn about bash, but keep exploring, reading, and asking. linuxcommand.org is a popular start ;)

      – Panther
      Dec 14 '11 at 16:46






    • 2





      In case there is more than one user, this changes it for all, which may or may not be the desired behavior

      – Walter Tross
      Jun 19 '15 at 17:35






    • 2





      by far the most straight forward and simplistic answer here

      – workabyte
      Jun 30 '16 at 21:31













    • simple and clear answer

      – Developerium
      Sep 2 '18 at 7:29
















    44














    Open a terminal and type the below command:



    echo set completion-ignore-case on | sudo tee -a /etc/inputrc


    Enter password. Restart terminal.



    If in some case you want to remove case insensitive, just edit /etc/inputrc file by removing the set completion-ignore-case line.



    That's all.






    share|improve this answer


























    • OK, I clarified that for you. It takes a while to learn about bash, but keep exploring, reading, and asking. linuxcommand.org is a popular start ;)

      – Panther
      Dec 14 '11 at 16:46






    • 2





      In case there is more than one user, this changes it for all, which may or may not be the desired behavior

      – Walter Tross
      Jun 19 '15 at 17:35






    • 2





      by far the most straight forward and simplistic answer here

      – workabyte
      Jun 30 '16 at 21:31













    • simple and clear answer

      – Developerium
      Sep 2 '18 at 7:29














    44












    44








    44







    Open a terminal and type the below command:



    echo set completion-ignore-case on | sudo tee -a /etc/inputrc


    Enter password. Restart terminal.



    If in some case you want to remove case insensitive, just edit /etc/inputrc file by removing the set completion-ignore-case line.



    That's all.






    share|improve this answer















    Open a terminal and type the below command:



    echo set completion-ignore-case on | sudo tee -a /etc/inputrc


    Enter password. Restart terminal.



    If in some case you want to remove case insensitive, just edit /etc/inputrc file by removing the set completion-ignore-case line.



    That's all.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Dec 12 '11 at 16:06









    regan

    74459




    74459










    answered Dec 12 '11 at 5:45









    emtin4emtin4

    807511




    807511













    • OK, I clarified that for you. It takes a while to learn about bash, but keep exploring, reading, and asking. linuxcommand.org is a popular start ;)

      – Panther
      Dec 14 '11 at 16:46






    • 2





      In case there is more than one user, this changes it for all, which may or may not be the desired behavior

      – Walter Tross
      Jun 19 '15 at 17:35






    • 2





      by far the most straight forward and simplistic answer here

      – workabyte
      Jun 30 '16 at 21:31













    • simple and clear answer

      – Developerium
      Sep 2 '18 at 7:29



















    • OK, I clarified that for you. It takes a while to learn about bash, but keep exploring, reading, and asking. linuxcommand.org is a popular start ;)

      – Panther
      Dec 14 '11 at 16:46






    • 2





      In case there is more than one user, this changes it for all, which may or may not be the desired behavior

      – Walter Tross
      Jun 19 '15 at 17:35






    • 2





      by far the most straight forward and simplistic answer here

      – workabyte
      Jun 30 '16 at 21:31













    • simple and clear answer

      – Developerium
      Sep 2 '18 at 7:29

















    OK, I clarified that for you. It takes a while to learn about bash, but keep exploring, reading, and asking. linuxcommand.org is a popular start ;)

    – Panther
    Dec 14 '11 at 16:46





    OK, I clarified that for you. It takes a while to learn about bash, but keep exploring, reading, and asking. linuxcommand.org is a popular start ;)

    – Panther
    Dec 14 '11 at 16:46




    2




    2





    In case there is more than one user, this changes it for all, which may or may not be the desired behavior

    – Walter Tross
    Jun 19 '15 at 17:35





    In case there is more than one user, this changes it for all, which may or may not be the desired behavior

    – Walter Tross
    Jun 19 '15 at 17:35




    2




    2





    by far the most straight forward and simplistic answer here

    – workabyte
    Jun 30 '16 at 21:31







    by far the most straight forward and simplistic answer here

    – workabyte
    Jun 30 '16 at 21:31















    simple and clear answer

    – Developerium
    Sep 2 '18 at 7:29





    simple and clear answer

    – Developerium
    Sep 2 '18 at 7:29











    9














    I know this question is very old but unless I am missing something I think I have a super simple solution if you are using bash.



    echo "bind 'set completion-ignore-case on'" >> ~/.bashrc


    Or just add the line using your favorite text editor. Restart your bash session and enjoy.






    share|improve this answer



















    • 1





      Well, you're missing something: ~/.inputrc is read by readline, which is what bash uses to provide this completion. Readline is also used by other programs, so, for generally setting this, ~/.inputrc as suggested the accepted answer would be better.

      – muru
      Jan 31 '16 at 2:50











    • Thanks for your suggestion, it teaches me a little more, but I have to say that it doesn't seem any simpler than the one I accepted, which just uses an additional line to ensure the new file doesn't nullify the old.

      – mwfearnley
      Feb 1 '16 at 20:52











    • perfect. well the only thing to remember is bind 'set completion-ignore-case on' should go in new line of .bashrc

      – Vishrant
      Aug 18 '18 at 23:20
















    9














    I know this question is very old but unless I am missing something I think I have a super simple solution if you are using bash.



    echo "bind 'set completion-ignore-case on'" >> ~/.bashrc


    Or just add the line using your favorite text editor. Restart your bash session and enjoy.






    share|improve this answer



















    • 1





      Well, you're missing something: ~/.inputrc is read by readline, which is what bash uses to provide this completion. Readline is also used by other programs, so, for generally setting this, ~/.inputrc as suggested the accepted answer would be better.

      – muru
      Jan 31 '16 at 2:50











    • Thanks for your suggestion, it teaches me a little more, but I have to say that it doesn't seem any simpler than the one I accepted, which just uses an additional line to ensure the new file doesn't nullify the old.

      – mwfearnley
      Feb 1 '16 at 20:52











    • perfect. well the only thing to remember is bind 'set completion-ignore-case on' should go in new line of .bashrc

      – Vishrant
      Aug 18 '18 at 23:20














    9












    9








    9







    I know this question is very old but unless I am missing something I think I have a super simple solution if you are using bash.



    echo "bind 'set completion-ignore-case on'" >> ~/.bashrc


    Or just add the line using your favorite text editor. Restart your bash session and enjoy.






    share|improve this answer













    I know this question is very old but unless I am missing something I think I have a super simple solution if you are using bash.



    echo "bind 'set completion-ignore-case on'" >> ~/.bashrc


    Or just add the line using your favorite text editor. Restart your bash session and enjoy.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 31 '16 at 2:41









    init3init3

    9911




    9911








    • 1





      Well, you're missing something: ~/.inputrc is read by readline, which is what bash uses to provide this completion. Readline is also used by other programs, so, for generally setting this, ~/.inputrc as suggested the accepted answer would be better.

      – muru
      Jan 31 '16 at 2:50











    • Thanks for your suggestion, it teaches me a little more, but I have to say that it doesn't seem any simpler than the one I accepted, which just uses an additional line to ensure the new file doesn't nullify the old.

      – mwfearnley
      Feb 1 '16 at 20:52











    • perfect. well the only thing to remember is bind 'set completion-ignore-case on' should go in new line of .bashrc

      – Vishrant
      Aug 18 '18 at 23:20














    • 1





      Well, you're missing something: ~/.inputrc is read by readline, which is what bash uses to provide this completion. Readline is also used by other programs, so, for generally setting this, ~/.inputrc as suggested the accepted answer would be better.

      – muru
      Jan 31 '16 at 2:50











    • Thanks for your suggestion, it teaches me a little more, but I have to say that it doesn't seem any simpler than the one I accepted, which just uses an additional line to ensure the new file doesn't nullify the old.

      – mwfearnley
      Feb 1 '16 at 20:52











    • perfect. well the only thing to remember is bind 'set completion-ignore-case on' should go in new line of .bashrc

      – Vishrant
      Aug 18 '18 at 23:20








    1




    1





    Well, you're missing something: ~/.inputrc is read by readline, which is what bash uses to provide this completion. Readline is also used by other programs, so, for generally setting this, ~/.inputrc as suggested the accepted answer would be better.

    – muru
    Jan 31 '16 at 2:50





    Well, you're missing something: ~/.inputrc is read by readline, which is what bash uses to provide this completion. Readline is also used by other programs, so, for generally setting this, ~/.inputrc as suggested the accepted answer would be better.

    – muru
    Jan 31 '16 at 2:50













    Thanks for your suggestion, it teaches me a little more, but I have to say that it doesn't seem any simpler than the one I accepted, which just uses an additional line to ensure the new file doesn't nullify the old.

    – mwfearnley
    Feb 1 '16 at 20:52





    Thanks for your suggestion, it teaches me a little more, but I have to say that it doesn't seem any simpler than the one I accepted, which just uses an additional line to ensure the new file doesn't nullify the old.

    – mwfearnley
    Feb 1 '16 at 20:52













    perfect. well the only thing to remember is bind 'set completion-ignore-case on' should go in new line of .bashrc

    – Vishrant
    Aug 18 '18 at 23:20





    perfect. well the only thing to remember is bind 'set completion-ignore-case on' should go in new line of .bashrc

    – Vishrant
    Aug 18 '18 at 23:20











    1














    You can do this by setting a configuration variable for GNU readline, which is what handles the input in an interactive shell.



    The variable needed is completion-ignore-case, and can be set directly in your bash session with:



    bind "set completion-ignore-case on"


    It can be enabled for all future bash sessions by putting it in the users's ~/.inputrc file, or the system /etc/inputrc, to enable it for all users. This is the initialisation file for readline.



    But note that if you create ~/.inputrc, this will override the system copy. (For me this caused me to lose some key mappings, such as Ctrl-Left/Right. You can see which ones by perusing the /etc/inputrc file.)

    The way to fix this problem is to put the line $include /etc/inputrc at the top of ~/.inputrc, e.g.:



    $include /etc/inputrc

    set completion-ignore-case on


    To apply the changes, restart bash or reload inputrc, e.g. with Ctrl+x,Ctrl+r.



    More information about readline and inputrc can be found in man bash and man 3 readline.






    share|improve this answer






























      1














      You can do this by setting a configuration variable for GNU readline, which is what handles the input in an interactive shell.



      The variable needed is completion-ignore-case, and can be set directly in your bash session with:



      bind "set completion-ignore-case on"


      It can be enabled for all future bash sessions by putting it in the users's ~/.inputrc file, or the system /etc/inputrc, to enable it for all users. This is the initialisation file for readline.



      But note that if you create ~/.inputrc, this will override the system copy. (For me this caused me to lose some key mappings, such as Ctrl-Left/Right. You can see which ones by perusing the /etc/inputrc file.)

      The way to fix this problem is to put the line $include /etc/inputrc at the top of ~/.inputrc, e.g.:



      $include /etc/inputrc

      set completion-ignore-case on


      To apply the changes, restart bash or reload inputrc, e.g. with Ctrl+x,Ctrl+r.



      More information about readline and inputrc can be found in man bash and man 3 readline.






      share|improve this answer




























        1












        1








        1







        You can do this by setting a configuration variable for GNU readline, which is what handles the input in an interactive shell.



        The variable needed is completion-ignore-case, and can be set directly in your bash session with:



        bind "set completion-ignore-case on"


        It can be enabled for all future bash sessions by putting it in the users's ~/.inputrc file, or the system /etc/inputrc, to enable it for all users. This is the initialisation file for readline.



        But note that if you create ~/.inputrc, this will override the system copy. (For me this caused me to lose some key mappings, such as Ctrl-Left/Right. You can see which ones by perusing the /etc/inputrc file.)

        The way to fix this problem is to put the line $include /etc/inputrc at the top of ~/.inputrc, e.g.:



        $include /etc/inputrc

        set completion-ignore-case on


        To apply the changes, restart bash or reload inputrc, e.g. with Ctrl+x,Ctrl+r.



        More information about readline and inputrc can be found in man bash and man 3 readline.






        share|improve this answer















        You can do this by setting a configuration variable for GNU readline, which is what handles the input in an interactive shell.



        The variable needed is completion-ignore-case, and can be set directly in your bash session with:



        bind "set completion-ignore-case on"


        It can be enabled for all future bash sessions by putting it in the users's ~/.inputrc file, or the system /etc/inputrc, to enable it for all users. This is the initialisation file for readline.



        But note that if you create ~/.inputrc, this will override the system copy. (For me this caused me to lose some key mappings, such as Ctrl-Left/Right. You can see which ones by perusing the /etc/inputrc file.)

        The way to fix this problem is to put the line $include /etc/inputrc at the top of ~/.inputrc, e.g.:



        $include /etc/inputrc

        set completion-ignore-case on


        To apply the changes, restart bash or reload inputrc, e.g. with Ctrl+x,Ctrl+r.



        More information about readline and inputrc can be found in man bash and man 3 readline.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 19 at 13:44

























        answered Oct 6 '18 at 14:03









        mwfearnleymwfearnley

        99921020




        99921020






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f87061%2fcan-i-make-tab-auto-completion-case-insensitive-in-bash%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Human spaceflight

            Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

            File:DeusFollowingSea.jpg