What happens when you type `ls *.c`

Screenshot taken October 10, 2016 at Holberton School

In this post, I will be breaking down the step-by-step of the shell command, ls *.c.

As referenced in man ls, the ls command lists the names of all the files and directories in the current directory. There are many flags that can be added to the command to filter and customize the display results, but today I will only be discussing what happens with *.c.

The * is a wildcard that can be used during script programming, and will match all characters and symbols and all lengths. This is done through the process of expansion, where the * will qualify everything. In our specific case, *.c will qualify all file and directory names that end with .c. Thus, the full command ls *.c will display the names of all files and directories ending with .c.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.