What happens when you type ls *.c?
Today we will learn about one of the most basic Linux Commands “ls” (List) First we need to know where and why we use this command.
This commands run in Linux Terminal or Shell, is a program that runs other programs, but when you hear shell in the Linux world, it almost certainly refers to a command line shell — the program that creates and manages the command line interface into which users type commands.
To open the terminal, press Ctrl+Alt+T in Ubuntu, or press Alt+F2, type in gnome-terminal, and press enter. or you can use vagrant, virtual box or other providers if you do not have a Linux Terminal in you machine.
When we type the command ls in Linux a Linux Terminal it shows the List of files and directories in the current working directory, as shown in the image.

As you can see the ls command output listed files(usually white colored, Green Colored when they have special permissions), and directories(Blue Colored, in this case only 1 directory “Test”). Like other Linux commands ls as its owns arguments like -a, -l, -x, etc. and also can use Wildcards, Wildcards are a set of building blocks that allow you to create a pattern defining a set of files or directories. As you would remember, whenever we refer to a file or directory on the command line we are actually referring to a path. In the case we are explaining what happens when you use ls *.c , The wildcard “*” stands for every file in the current working directory and files inside Sub-directories, This is an example of ls *

As you can see, it listed all the files in the Current Working Directory and the test files(file1,file2,file3,file4,file5) inside the sub-directory called “test”. You can use different arguments in the same command line to look for something more accurate or specific, in the case of the command ls *.c You are listing (ls) all the files (*) with .c (.c).

As you can see the command list only the files with matching with .c on its name .the .c file extension is used for Language C files which is another Programming Language used to develop software. You can find more information about Linux Commands in http://linuxcommand.org and using the manuals in the Linux terminal.