Numbers of Hard links, I don't undertand it very well. why it's printed 4 instead of 6?


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are asking about.>
https://www.codecademy.com/fr/courses/learn-the-command-line/lessons/manipulation/exercises/ls-l

<Below this line, describe in what way does your code behave incorrectly? Include ALL error messages.>
When I typed the ls -l command, the column that shows the number of hard links shows 4 for all directories (actions, comedy, drama). But the course said that those numbers counts the numbers of child directories and files including parent directory link and current directory link. according to that and when i look to the tree provided at reference, i expected to see there
6 actions (because, actions contains 2childs directories + 2files + parent & current directories links)
4 comedy (because it contains 2childs directories + parent & current directories links)
4 drama (because it contains 2childs directories + parent & current directories links)
thank you for help and sorry for my english i’m a french speaker.

<Below this line, add a screenshot of your whole web browser so that we can see what you see.>

https://www.codecademy.com/fr/courses/learn-the-command-line/lessons/manipulation/exercises/ls-l


#2

the column only displays the number of hard links, which is 4 for action:

current directory .
parent directory of action ..
parent directory of scifi ..
parent directory of superhero ..

which is 4.

so it counts the number of hard links in child directories, yes, but doesn’t count the directories or files


Ls -l command (hard links)
#3

156/5000
Thanks for the instant response. Frankly I did not expect to get my problem solved as quickly. Thanks again. it’s really cool here:yum::blush:


#4

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


Numbers of Hard links - Terminal Output does not match instruction output