What happens when you type ls *.c
what does really happen when typing “ls*c” Into a Shell and pressing Enter. let’s start by a brief definition of the components you have to use to execute this command.
What is Shell?
Shell is a program that executes other programs by taking commands from the keyboard and giving them to the operating system to perform .
What’s an operating system ?
An operating system is the most important software without it a computer is useless it’s a system software that provides common services for computer programs. It allows us to communicate with the computer, example of operating system are Microsoft Windows, macOs and Linux.
In order to execute a command and in our case the “ls*c” command you have to open the terminal, type the command and press enter.
What’s a Terminal?
A Terminal is a graphic User Interface that allows you to type commands in order to be executed.
the terminal gives us flexibility to interact with computers by giving it instructions to perform something.
Now we know the definition of Terminal, Shell and an Operating System we can pass to the command.
What’s a command ?
A command is a an order you type into a computer to causes it to perform certain operations for example the ls command .
The “ls” Command
The ‘ls’ command allow us to list directory contents as simple as it sounds it’ll display everything inside the directory and once mixed with options it gives us the ability to know information about the file like the author of the file the size, the file type …
What does * Means?
* is a character that is used to increase the efficiency and the flexibility of a search is what do we call a “ Star wildcard” it represents every sting so it gives us the ability to return information of every object in the directory.
So what does really happen when we type type ls *.c
Regrouping all the information we just learned, when typing “ls *.c “into a Terminal and pressing enter we give the computer an order to provide us with all the files whose names end with .c located in the current working directory.