From the course: Linux: Files and Permissions

Unlock the full course today

Join today to access over 24,500 courses taught by industry experts.

Matching files with extended globs

Matching files with extended globs - Linux Tutorial

From the course: Linux: Files and Permissions

Matching files with extended globs

- [Instructor] For this exercise, be sure that you're in your globfiles directory. For me, this path is slash home, slash user1, slash exercisefiles, slash ch01 for this chapter, slash globfiles. You can see your paths by typing in pwd. Extended globs may have to be turned on in your version of Linux. To check if they're turned on, type into a terminal, shopt and hit enter. Now look for the extglob shell option. If extglob is not turned on, then type in shopt, space dash S, space extglob and hit enter. To make this persistent, you need to put this line in your bashrc startup file. Let's start exploring extended globs in a simple manner. Type in clear and then type in ls space photo, at symbol, left parentheses and a pattern of abc, right parentheses dot jpg. The at symbol says to match only one occurrence of abc which results in it matching photoabc.jpg. Now let's change it to match zero or one occurrence of abc.…

Contents