~/ learn/ comp-325/ cards/ One bracket, one position
1 of 10

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)

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/ee4c85a1-06c2-44dd-87ea-a33d70722625/flashcard utf-8 LF