Learning the Shell: What happen when you type “ls *.c” in your Shell?

What is the shell?
The shell is a program that takes commands from the keyboard and gives them to the operating system to perform.
What is a terminal?
It’s a program called a terminal emulator. This is a program that opens a window and lets you interact with the shell. There are a bunch of different terminal emulators you can use. Most Linux distributions supply several, such as: gnome-terminal, konsole, xterm, rxvt, kvt, nxterm, and eterm.

You can use a lot of command in your terminal but for today we are going to talk about ls command.
ls Command
ls is a Linux shell command that lists directory contents of files and directories.


ls command have a lot of main options but for now we will talk just about the “*” (wildcard) with .c option

The ls command with *.c will list all the files with “.c” extension so will be really useful if you have a lot of file and you just need to list the ones that have this “.c” extension for example:
If i use just the command ls in my terminal i will see all the files that i have in a directory

But if i add *.c to the command ls i will see just the files with extension .c

So in this way you will list all the files with .c extension. I hope this blog helped you.