The two worked patterns, against the six-file lab directory
The two worked patterns, against the six-file lab directory
Answer
ls lab[0-9]?.c ls lab[!5]*.c ls lab[^5]*.c
The last two lines are the same pattern twice: [!…] is the POSIX spelling and [^…] the widely-supported alias. Both are examinable, and bash accepts either.
Sarwar & Koretsky 3e ch4 §4.5.2; POSIX.1-2024 XCU §2.13.1 (the [!…] spelling)