From the course: Linux: Files and Permissions

Unlock the full course today

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

Advanced extended globs

Advanced extended globs - Linux Tutorial

From the course: Linux: Files and Permissions

Advanced extended globs

- [Instructor] We'll be running these commands in our globfiles directory again. For me, that is in /home/user1/ExerciseFiles/ Ch01 for chapter one, /globfiles. Let's do something standard globs can't do. Let's create two patterns matching the beginning and the end of a file name, and then group that together and invert it. Type in ls -d !, left parentheses, @, left parentheses, photo|video, right parentheses *@, left parentheses.jpg|.png, right parentheses, right parentheses. Take a moment to visualize what this will show. When done, press Enter. Is the output what you expected? At first glance, it may look like this would not list any files that start with photo or video, or in with .jpg or .png, but we see files in our output that start with video and photo, so what's going on? Let's analyze this extended glob. Our first pattern matches the word photo or the word video and specifies that exactly one has to be…

Contents