Wednesday, May 8, 2024
293
rated 0 times [  293] [ 0]  / answers: 1 / hits: 145976  / 1 Year ago, sun, may 21, 2023, 9:51:08

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


But I think sometimes it would 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?


More From » command-line

 Answers
0

In order to make bash case-insensitive for to current user:



Run the following shell script in a terminal:



# If ~/.inputrc doesn't exist yet: First include the original /etc/inputrc
# so it won't get overriden
if [ ! -a ~/.inputrc ]; then echo '$include /etc/inputrc' > ~/.inputrc; fi

# Add shell-option to ~/.inputrc to enable case-insensitive tab completion
echo 'set completion-ignore-case On' >> ~/.inputrc


Start a new shell (reopen the terminal).



To Make the changes systemwide:



# add option to /etc/inputrc to enable case-insensitive tab completion for all users
echo 'set completion-ignore-case On' >> /etc/inputrc
# you may have to use this instead if you are not a superuser:
echo 'set completion-ignore-case On' | sudo tee -a /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.


[#41508] Monday, May 22, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
poous

Total Points: 81
Total Questions: 101
Total Answers: 119

Location: Cambodia
Member since Sat, Oct 3, 2020
4 Years ago
;