What’s up with ls *.c ?

Daniel V.
2 min readJun 8, 2020
Image 1. Man page for ls

The ls command enumerate the content and optional information about files and directories.

Command?… What is a command?

A command is a reserved word that the operating system uses to executes certains task or actions using a terminal. A terminal is program with which commands can be executed.

Image 2. Linux Terminal

The ls command must be write in this program.

So… What about the “*”?

As we already mentioned (ls) allows us to see the list of files and directories, it is worth mentioning that each command has a series of options that increase its use capabilities one of these options calls wildcards, that simplify expressions and save time writing commands, the following are some examples of them:

Image 3. Some wildcards

And now, let’s do it!

The command ls *.c, list all files or directories that end .c

Image 4. ls *.c in the terminal

Yeah! it’s easy to use.

For more information about this topic I recommend to you the next topics:

--

--