¿What happens when you type <ls *.c>?
We have this little exercise today, and It is, what happens if you type in your shell the next command:
¿What will it display?
So to answer this question, first we need to understand what we are typing.
ls command is used to display a list of the files and directories that are in the current directory. Let’s see an example:
As you can see in the current directory are 6 files and 2 directories.
Now let´s move on
Now you just want to list the files whit a specific extension, and to do that you will need to use an asterisk (*). That is useful to match an extension, in this case <.c>. So observe the next image:
As you can see in the first case It is typed <ls> and it displays all files in the working directory, but in the second case <ls *.c> it matches the files with the extension .c and displayed them.
¡And there you go!
Now you know how to display a specific group of files, I recommend you to keep reading and studying so you may learn even more stuff about this and other commands