What is inside a directory? (ls *.c overview)
https://tipskeren.web.id/cara-mudah-menyembunyikan-dan-memulihkan-foto-video-dan-folder-di-smartphone-xiaomi/

What is inside a directory? (ls *.c overview)

There are two types of environments in your operative system. The first and the most common one is the Graphic User Interface (GUI), and the second one is the Command Line Interface (CLI). In a graphic environment, we normally double click a folder to see what its content, on the other hand, in a CLI we have to use commands to do the same task, in this case, the command is ls.

What is ls? [ ls ]

ls is the command used for list directory contents (visit: man ls). In the next example directory, we need to display its content only by using the ls command.

vagrant@vagrant-ubuntu-trusty-64:~/example$ ls
file  file.c  README.md
vagrant@vagrant-ubuntu-trusty-64:~/example$

Wildcard-expansions [ * ]

Wildcards a shell feature that rapidly helps the user specify groups of filenames or more directories. In this example, in this case, the asterisk stands for a pattern that matches all the files.

vagrant@vagrant-ubuntu-trusty-64:~/example$ # [command]  -  [wildcard]

File Format extension [ .c ]

Normally filename includes the description of what the file is about or the task it develops in this example the namefile " file " tells the user how is that file named.But using a filename extension, in this case, a " .c " extension it is telling the user that a file can be only executed by " .c ", for this example the source file is called " file.c ". In other words, a filename extension is specified as a suffix to the filename. Other filename extension examples:

file.txt
file.html

Command execution [ ls *.c]

vagrant@vagrant-ubuntu-trusty-64:~/example$ ls
file  file.c  README.md
vagrant@vagrant-ubuntu-trusty-64:~/example$ ls *.c

Conclusions

In human words what the command " ls *.c " is all the ones that have .c extension

Further reading

Filename extension

Linux man page

Manipulating Files

The Feynman Technique: The Best Way to Learn Anything

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

Alejandro Franco Cede?o的更多文章

社区洞察

其他会员也浏览了