What happens when you type ls *.c
Among the many shell commands at your disposal,
ls remains among the most heavily used commands in shell. When you type man ls and hit enter, the manual page for the command
ls appears, and it is here where you can learn all about the command.
From the description we know that
ls displays information about the files in a certain directory (current directory by default).
To refine the results we want
ls to return, we may add arguments after
ls *.c). In the case of
ls is the command, and
*.c is the argument. Asterisk (*) is known as a wildcard; when an argument contains this wildcard it causes shell to perform pathname expansion. In the case of the asterisk wildcard, it expands into any possible combination of characters with varying length, causing * to stand for anything. This leads to the case of
ls *.c where we want
ls to print information on files beginning with anything ,but ending with
Compared to the results of ls without arguments,
ls *.c only returned files ending with