~/ 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/5a7833c8-fff8-4ef9-b42d-acbcad733ef6/flashcard utf-8 LF