Julian Mendez
2 min readSep 15, 2020

--

What happens when you type ‘ls *.c’

This is post explaining how what exactly is ‘ls *.c’ and how you can use it.

What is ‘ls’ and how to use it?

Let’s read what the manual said:

As you should know, you can find a manual for every command, you just need to write into the shell “man ls”

This the manual for ‘ls’ command

So ‘ls’ is a command used to get a list of files and directories but you also can use a Options to get additional information or list the files and directories the other ways.

The options are described below of the manual, for example ‘-a’ option, going to print all the files even if they are hidden.

Using only ‘ls’ with any option.

Using ‘ls -a’

The files hidden starting with a dot .

There are other options that you can use.

But, what really happens when we type ‘ls *.c’

‘ls’ is the command used to print a list of files and directories.

The ‘*’ is an Expansion, this character means match any characters in a filename.

‘.c’ in this case means the part of file’s name that the command going to print, and only the files with this character appear.

The files are print cause the have ‘.c’

As you can see this is an easy way to find files..

--

--