ls *.c and pathname expansion

First, the shell first starts to try to identify what “ls” is.

The shell has a list of places to check for commands. If ls is on the “alias” list, it will run the command that ls is “aliased” to.

Next, the shell looks for a program called “ls.”

The shell goes through one a list of places where the program might be. This list is called the PATH variable.

The shell goes through the directories and finds the ls program in the /bin directory and executes it.

Next, the shell interprets the argument “*.x” is a wild-card and stands for any alphanumeric string of any length, it is thus expanded to represent all the possible values which in this case are all the files in the working directory

The list is then filtered down to any file or directory whose final two characters are “.c”

Those files and directories are then printed to the screen.