From the course: Linux: Shells and Processes
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Extended glob exercise - Linux Tutorial
From the course: Linux: Shells and Processes
Extended glob exercise
- We'll be running these commands in our glob files 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 space -d space ! left parenthesis @ left parenthesis photo|video right parenthesis *@ left parenthesis .jpg|.png right parenthesis right parenthesis. 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 end 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
About Linux shells6m 21s
-
About Linux terminals1m 50s
-
(Locked)
Shell pathname tricks7m 7s
-
(Locked)
Shell history tricks3m 29s
-
(Locked)
Configure shell history6m 59s
-
(Locked)
Variables and shell environment5m 33s
-
(Locked)
Make shell variables persistent6m 48s
-
(Locked)
Pattern matching with globs5m 9s
-
(Locked)
Globs exercise6m 42s
-
(Locked)
Pattern matching with extended globs6m 25s
-
(Locked)
Extended glob exercise4m 22s
-
-
-
-
-