What happens when you type ls *.c

Before explain what does “ ls *.c”, i want to explain what is the command “ls”.

The command “ls” list all folders and files in the current directory, this is the basic command without parameters.

It is really practical in a common basis, when you want to know what files & folder there in your current directory, you just need to put this command in shell, it’ll display all theses files and folder for you.

But the command “ls” can be used more specifically like in the title, with this syntax “ls *.c”, so now we know what “ls” does, i want to know what does the “*.c” with the command ls.

So the “*.c”, will tell to the command “ls” to display only all files & folders that has the extension “.c” at the end.

So this what the command does, you can add more parameters and filter than that but i will not explain other ways today.

Stay tuned.

Software engineer student at HolbertonSchool 👉https://github.com/ThibautBernard 👉https://twitter.com/__ThibautDev

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store