Command ls -l and its number counting

I typed ls -l and it shows “Number of hard links. This number counts the number of child directories and files. This number includes the parent directory link (…) and current directory link (.).” I am confused here.

As you can see the screenshot below, the action directory has more than 4 files and directories. I would like know why commad ls -l at movies directory showing only 4 for action directory. Should .txt file also have to be counted as a file?

This is the exercise link regarding to my question:

If you look at ls -a you’ll see, . and .. in the list. Now use, ls -alt to get a complete breakdown.

Active links refer to directories, only, not files. Again, look at ls -a in that folder and count the directories, only. . .. scifi superhero


Please remember to post a link to the exercise with every new question, in addition to your screenshot (for this module) since we cannot copy from the console. It will add tremendous value to this topic where other users are concerned, especially new learners with the same question. If they can confirm your question is from the same lesson, perhaps they can end their search and heed the replies they find there. Just saying…


Thank you! I added the exercise link.

I see that the active links do not refer to files. But, then, why the explanation on the exercise link says" Number of hard links. This number counts the number of child directories and files. " ?

If you believe the lesson text or instructions to be in error then the best thing to do is report it using the Bug Report form below the instructions.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.