What happens when you type “ls *.c” into your shell?
The first step is to know what ls means:
The ls command writes to standard output the contents of each specified Directory parameter or the name of each specified File parameter.
Now, each time you type a command line and press the enter key, bash performs several processes upon the text before it carries out your command, in this case, a list.
But what about the *.c?
The * matches any characters in a filename. When the enter key is pressed, the shell automatically expands any qualifying characters on the command line before the command is carried out.
The .c is a file extension. A file extension (or simply “extension”) is the suffix at the end of a filename that indicates what type of file it is. For example, in the filename “hello.c,” the .c is the file extension. (.c files are C programming language files)