ls *.c in a nutshell

Mohamed Foued Jenni
2 min readSep 15, 2020

--

ls command

*Introduction

In computing, ls is a command to list computer files and directories in Unix and Unix-like operating systems.

*How to use ls command

The syntax for the ls command is as follows:

In this article we are taking an example of “ls *.c “, so this command is composed into two parts : “ls” and “*.c” .

As we learned before “ls” is a command used to show list files and directories and the results changes as we change the option or case the pattern in our case we have “*.c”.

An asterisk “*” is a wildcard if combined with ls like this “ls *” it shows all files and directories in the current directory and here is an example :

ls *

Finally by adding “.c” we get “ls*.c” which means list all files and directories in the current directory ending with .c .

ls * .c

In my situation i had no files that match the pattern .

That’s it for this article thank you for reading see you in the next article .

--

--

Mohamed Foued Jenni
Mohamed Foued Jenni

Written by Mohamed Foued Jenni

Software engineer | AR/VR student

No responses yet