Ls -l command (hard links)

In the long list format, the second column represents the number of hard links.
Does anyone know what are hard links and how to count them? :sweat::sweat:

Isn’t the count explanation within the exercise? Can you link the exercise?

I didn’t really get the explanation
what did parent directory link and current directory link mean?
And i saw in another post that the files and directories were not counted??

I do apologise if it’s a very dumb question, just very new to all of this :frowning:

its say right here:

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 (.).

for example in the lesson:


4 make sense for the action directory:
current directory (.)
parent directory (..)
scifi directory in action directory
superheroes directory in action directory

just a bit confused about what a current directory link is?

ls -a will show all hidden files, include .. (parent directory) and . (current directory), which are hard links

if we want to execute a script in the current directory, we can do ./ or something. . here indicates the current directory. If you just did, it would look in PATH

1 Like

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