Ls command
ls is a shell command that list all files and directories in the current directory
so if you want to see the content of a directory using terminal just type ls and push enter and this is an exemple of the result
That’s not all!!! there’s more options
if you want to sort the content of your current directory in long format you need to type ls -l and when you hit the enter button you will get the files and folders names , their dates of creation , the name of the createur (the user) and their permissions and here’s an other exemple of the output
But what happen when you ls *.c??
if we want to list all files with specific extension we can use simply ls *.the_specific_extension , * means recursivity so ls *.c shows you exectly every folder or file with .c extension in the current directory and all his sub-folders and here’s an exemple :
And there’s more and more options of the magic command ls if you want to know more about it just type man ls in you shell script .
written by Hadir Jenni