List all the files with .c extension Linux

List all the files with .c extension Linux

The regular commands that we used to see in Linux actually came from Unix. One of them is ls that we use to list files and directories.

The most common use of ls is just to print our current directory but is more powerful than that. Look this example:

No hay texto alternativo para esta imagen

In the above image we listed all of our home’s directory(~) with the flag -l and show a lot of information:

Columns

  1. Permissions for owner, group and others.
  2. Number of links
  3. Owner of the file or directory
  4. Group of the file or directory
  5. Size in bytes
  6. Updated date
  7. Name of the file or directory

There is a lot of information displayed only with the -l flag. If you want to know more about this command I advice you to look the man page like this:

man ls

No hay texto alternativo para esta imagen

If you want to list all the files with a .c extension only you can put this:

ls *.c

Look all the files in the current directory:

No hay texto alternativo para esta imagen

Listed only with .c extension:

No hay texto alternativo para esta imagen

The * is a greedy quantifier for more information about that follow this link

要查看或添加评论,请登录

Sebastian Lopez Herrera的更多文章

社区洞察

其他会员也浏览了