When tried the command
me@me:~$ ls -hl | head -5
total 60M
-rw-r--r-- 1 me me 250 Jan 16 11:43 $tty
-rw-r--r-- 1 me me 0 Jan 16 11:41 1
drwxr-xr-x 2 me me 4.0K Jan 16 15:28 Desktop
drwxr-xr-x 7 me me 4.0K Jan 13 14:33 Documents
Found that Documents
directory has 7 hard links, what's the reason for such a redundancy?
If the directory
Documents
has seven hard links, this means that:One hard link is from the name
Documents
in its parent directory.One hard link is from the entry
.
inDocuments
itself.Five hard links are from the entries
..
in five subdirectories.Column #2 in the output of
ls -l
shows the number of hard links(?)Folders alias directories cannot be hard-linked (but they can be linked to with symbolic links). The number in the same place as number of hard links for files means something else, related to how much space the folder needs in the file system's 'table', because the number grows with the number of sub-folders.
Hard links means that the data at a certain inode are pointed to by more than one file name (so the hard-linked names share the same inode number).
There is a detailed explanation by Sergiy Kolodyazhnyy at this link and this comment by him,
Column #5 in the output of ls -l shows the file size(?)
But what about folders -- most folders occupy 4 kiB, but when there are many files (and sub-folders) the names cannot get squeezed into 4kiB and more space will be allocated, 8 kiB, 12 kiB etc. My 'worst' case is a Firefox cache folder with the 'size' 4012 kiB. It contains 58971 files, and these files occupy 2.2 GiB. This reminds me that it is getting time the clear the Firefox cache ;-)
You can check that your Documents folder's inode number is unique, no other file or folder shares it. You can check other folders too.
Try the following commands (maybe modified, if you have another language (than English).
Identify the inode number (you will get another number than I)
Search for files/folders with that inode number (and try to avoid too many warning/error outputs)
or
The following example shows the corresponding case with three hard-linked file names.
Identify the inode number
Search within the file system (in this case my
data
partition)