Hidoussi Abderrahmen
1 min readJun 8, 2020

What really happens when you type ls *.c

Each time you type a command line and press enter, the bash performs some alteration upon the written text.
today however, we are looking into the example of the “ls *. c”, the usual output of “ls” is the listing of all files under the current directory (excluding hidden ones of course), but as most commands in Linux an alteration to the output can be made by using extra options and “wildcards”.

a “wildcard” is a character or a string that the bash transform before processing the command line, and in our case “*. c” the “*” indicate all the files that are present in the current directory, and “. c” indicate that the files will have “. c” extension and thus when we combine all the above the result is a list (ls) of all the files (*) in the current directory that have the extension of (. c)

No responses yet