List all the files with .c extension Linux
Sebastian Lopez Herrera
FullStack Software Engineer | Spring Boot | AngularJS | ReactJS | Javascript | 4+ years of experience
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:
In the above image we listed all of our home’s directory(~) with the flag -l and show a lot of information:
Columns
- Permissions for owner, group and others.
- Number of links
- Owner of the file or directory
- Group of the file or directory
- Size in bytes
- Updated date
- 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
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:
Listed only with .c extension:
The * is a greedy quantifier for more information about that follow this link