Enabling the shell option with the shopt built-in command (EXTGLOB) recognizes several extended pattern matching operators
The pattern list is by | Segmentation
View Shell Options Extglob
Shopt |grep Extglob
Start Shell Option Extglob
Shopt-s Extglob
Turn off shell option Extglob
Shopt-u Extglob
? (pattern-list) |
Match a given pattern 0 or one time |
* (Pattern-list) |
Matches a given pattern 0 or more times |
+ (Pattern-list) |
Matches a given pattern one or more times |
@ (pattern-list) |
Match one of the given patterns |
! (pattern-list) |
Match in addition to the given pattern |
[email protected] ~]# LL
Total 0
-rw-r--r--1 root root 0 Nov 1 07:02 123
-rw-r--r--1 root root 0 Nov 1 07:02 aaaac
-rw-r--r--1 root root 0 Nov 1 06:51 aaab
-rw-r--r--1 root root 0 Nov 1 07:02 AAD
-rw-r--r--1 root root 0 Nov 1 07:02 AADG
-rw-r--r--1 root root 0 Nov 1 07:02 bb
-rw-r--r--1 root root 0 Nov 1 07:02 C
[[email protected] ~]# ls! (c|bb|123)
AAAAC Aaab AAD AADG
[Email protected] ~]# RM! (c|bb|123)-F
[email protected] ~]# LL
Total 0
-rw-r--r--1 root root 0 Nov 1 07:02 123
-rw-r--r--1 root root 0 Nov 1 07:02 bb
-rw-r--r--1 root root 0 Nov 1 07:02 C
Shopt built-in command enable Shell option (EXTGLOB)