When displaying directories using
ls -l, their number of links (the second field in the output) is at least two: one for the dir name and one for
$ mkdir foo $ ls -l total 2 drwxr-xr-x 2 user wheel 512 4 oct 14:02 foo
Is it safe to always assume that the number of links above 2 corresponds to the number of subdirectories in this dir (
.. links) ?