6️⃣Wildcards

A wildcard is a character or a string of characters that can be used as a substitute for any other character(s) in a command-line expression.

  • * - zero or more characters

  • ? - single character

  • [] - range of characters

ls -l file*

this command prints all the files with expression file and anything after that. More clearly, it prints files starting with file and upto any characters after that.

prints file with file as starting
prints only txt files

can only have characters a,b and c and 123 after that

prints files with any first character and after that any number from 1-3

  • ^ - beginning of line

  • $ - end of line

Last updated