ls *.c

Milena Molina Montoya
2 min readJun 10, 2020

--

What is it? .. that makes?

Let’s learn a little about what commands are, where they come from, what they’re for. Today I will talk about the command ls *.c

ls is one of the basic commands that the linux shell gives us to be able to manipulate files and directories in a quick and practical way.
you wonder .. and what does ls do? well the answer is very simple, when executing this command it lists or prints the existing files in each directory or file. To be sure you understand the concept I will show an example.

let’s do it step by step.
In image 1 we write the command ls

Image 1

In the second image … we give ENTER and the list of the files that are available in my directory appears.

Image 2

Now what is ls *.c for as you can see in the image a good number of files are listed, but I want to see a specific file, there we use this combined command ls (list) * (asterisk selects all) and .c is the extension of files created of type C. It would look like this.

Image 3

as you can see by typing the command ls *.c giving ENTER lists only the files with extension .c

And this is one of the ways to use this command, since it has several more combinations. I hope you have understood the concept, until a next command. !! Thank you

--

--