From the course: Linux CentOS 7: Files and Permissions

Unlock the full course today

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

Pattern matching using extended globs

Pattern matching using extended globs - Linux Tutorial

From the course: Linux CentOS 7: Files and Permissions

Start my 1-month free trial

Pattern matching using extended globs

- [Instructor] In addition to standard globs, Bash allows us to use extended globs. This is an option that may be turned off in your version of Linux. Check to see if it's turned on, type in a terminal. S-H-O-P-T and hit enter. Look through the list and find E-X-T glob and ensure that's turned on. If it is not turned on, you'll need to type in S-H-O-P-T space dash S space E-X-T glob and hit enter. To make this persistent you'll need to put it in your bash R-C startup file. Extended globs give us more pattern matching power. They grant us the power to specify the number of occurrences to match, which is difficult to do with standard globs. They also allow grouping matches. Patterns can be more than one character. If you want to match three occurrences of A-B-C we could. They also allow us to match one pattern or another. With extended globbing we can specify zero or one occurrences of a match. For instance, if we want to match zero or one occurrence, of the letters A-B-C, we'd use…

Contents