Using ls *.c

This blog has the information about the Linux command list “ls” for list all c files.

First, we are going to see the syntax:

ls [OPTION] [file]

only type ls print the files and directories in your current directory. But when you use options you can print long formats, hide files, information about the author, etc. However you can type wildcards like *, It is like an all word and if you write something after that you are (ls *something) listing all files that end with that you wrote (in this case something)

Now we are going to type ls *.c, It means:

  1. listing (ls)
  2. all (*)
  3. c files (.c)


William E. Shotts, Jr., The Linux Command line 4th edition, book