From the course: Linux: Files and Permissions
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Using character classes - Linux Tutorial
From the course: Linux: Files and Permissions
Using character classes
- Linux also provides a mechanism for matching certain character classes. A character class is a grouping of light characters. For instance, letters, numbers, punctuation, and so on. There is support for various character classes at Bash, so let's get into it. Instead of including all characters you want to match, you could use a class. To match whole numbers, use the digit character class. This would be equivalent to using a range of zero through nine. Sometimes the syntax is more complex using character classes, but they're ultimately more powerful and reliable than character sets alone, so I do recommend using them. To match uppercase characters, we can use the upper class. This is equivalent to uppercase A through Z. For lowercase letters, use the lower class, which is equivalent to lowercase A through Z. If you want to match both upper and lower case characters, use the alpha character class, which would be equivalent…
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
-
-
-
What is a file?4m 59s
-
(Locked)
Getting information about files5m 29s
-
(Locked)
About extended attributes3m 54s
-
(Locked)
Getting extended attributes4m 14s
-
(Locked)
About file globs5m 9s
-
(Locked)
Using character classes3m 7s
-
(Locked)
Using globs to match files6m 42s
-
(Locked)
Matching with brace expansion6m 11s
-
(Locked)
The Magic of extended globs6m 25s
-
(Locked)
Matching files with extended globs2m 22s
-
(Locked)
Advanced extended globs4m 22s
-
-
-
-
-