A QUICK REFERENCE TO… SHELL WILDCARDS
Wildcards are used to match multiple files in a shell. The two main wildcards are * and ? . * matches any number of characters, so *.jpg is expanded by the shell to a list of all files with a .jpg extension. It is important to understand that this expansion is done by the shell before passing the list of files to whatever command you’ve called. If you have two files called in.txt and out.txt, and run $ ls *.txt ,the shell replaces the wildcard expression with a list of matching files, then calls the command, so it runs: $ ls in.txt out.txt