What happens when you type ls *.c
When we think of a command we must also think of the environment that performs its function, and for this case, this environment is called SHELL, also called interpreting commands or command interpreter, which provides an interface to the user to access the services of the operating system.
Knowing this, we can give our code space to carry out its work.
We could say that 'ls' is one of the most used commands in the LINUX SHELL, which lists the files and directories that are in the current working directory, showing from hidden files with the '-a' option to the information More detailed with the '-l' option, finding this feature-rich command to list and display the contents of working directories.
At this moment we seek to solve the question that we have in the title, what happens when I write 'ls * .c' ?, already understanding that 'ls' is a command to list the contents of the working directory, we will find it easier to understand the functionality of 'ls * .c'.
The '*' character has the specialty of being taken by the shell, as a reference to any character string in the name of a file, this character is among the group of wildcards that we have to complement some commands, as we see in the example with echo command.
At this moment we have the command 'ls *' which translated into our serious language, list all the files and directories, if we add a value to search for this, which in this case is an extension of a '.c' file, with This extension would translate like this, listing all the files and / or directories that contain in its name '.c', which would give a result similar to how we find it in the image.
In this case the command found 2 files with these characteristics in the working directory.