From the course: Bash Patterns and Regular Expressions

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

The effect of locale on searches

The effect of locale on searches - Bash Tutorial

From the course: Bash Patterns and Regular Expressions

Start my 1-month free trial

The effect of locale on searches

- [Instructor] In the last video, we saw that the uppercase A through uppercase Z character set didn't match what we thought it should. To better show how this works, lets change into the alphafiles directory in our exercise files. Type in cd space alphafiles/ and hit enter. Now type in pwd to show your path. My path is now /home/user1/Exercise Files/Ch 01/alphafiles. Now, type in clear, and then type in ls to list the files. We can see all files show up, and even files with diacritic marks. Now, let's bring our character set back up. Type in ls space [A-Z] and hit enter. We see that it matches both upper and lowercase file names, however, our first clue to what is going on is that it starts with uppercase A and ends with uppercase Z. Notice, there are lowercase versions of everything but the letter A. What is happening is that with our current locale settings, the order of letters is as you can see on the screen, our range is uppercase A through uppercase Z. If you draw a box around…

Contents