* : Match on any set of characters in filenames

 

$ ls

doc1 doc2 document docs mydoc Monday Tuseday

 

$ ls doc*

doc1 doc2 document docs

 

$ ls *day
monday tuesday


$ ls m*d*
monday

 

$ ls *.c
calc.c main.c


$ rm doc*

 

 

? : Match on any single character in filenames.

 

$ ls
doc1 docA document


$ ls doc?

doc1 docA

 

 

 

[] : Match on a class of characters in filenames

 

$ ls
doc1 doc2 doc3 docA docB docD document


$ ls doc[1A]
doc1 docA


$ ls doc[1-3]
doc1 doc2 doc3


$ ls doc[B-E]
docB docD


$ ls *.[co]
main.c main.o calc.c