From the course: Linux: Shells and Processes
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Pattern matching with globs - Linux Tutorial
From the course: Linux: Shells and Processes
Pattern matching with globs
- [Instructor] One of the reasons that manipulating files on the command line can be faster and more efficient than the GUI is file globbing. File globbing uses patterns containing wildcards to match files based on their names. For instance, if you wanted to list all filenames starting with the word file followed by any extension, you could use ls space file asterisk. This glob can be used with any command as the globbing is handled by the shell itself. You can practice the globs in this video using the files I've provided in this chapter's directory of the exercise files archive. The first wildcard we'll cover is the asterisk. An asterisk matches zero or more of any type of character. It matches everything and nothing. Let me explain. In this example, I'm using a glob of file asterisk. The asterisk would match the letters .txt, .jpg and .tar.gz, but it would also match a file named file. The reason for this is that file…
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
-
-
-
-
-