Listing Files ls Command Linux “ls *.c” Especially

Ahmed Belhaj
2 min readSep 14, 2020

The ls Command Linux Shell What is it ?

In Unix file system and Unix-like ls command one of the most common usable command and your way into Unix , its simple and come with option and when it come to option it become one of the most useful one . It List information about the file in the current working directory when used without option and optimization .

Our Current Directory is Article

ls * is it different ?

Actually NO ls * it does the same thing as ls that's only when it’s alone nothing before nothing after .

The * is called a wildcard , its a symbol used to replace or represent one or more character it can used with other characters not just one multiple in our case we will check *.c

So What happen when we use ls *.c

This command is consisted from The Unix command “ls” and asterisk “*” and file extension “.c” .c is C programing language file extension .When we combine The file listing command with “*.c” the command will list The file with the file extension .c , the asterisk in our case represented the all the character before “.c” so The file name

Same Directory as before different output

This The same directory as before but the ls in our case listed only the files with .c extension

--

--

Ahmed Belhaj

Dedicated DevOps Engineer with expertise in system administration, core development, and a full-stack software development.