Just to add a bit of complexity, the number depends on the filesystem used. While true for an ext* filesystem that the number reflects the count of the number of folders within a directory, including the pointers to its parent and itself ( .. and . ), that may not be true on other filesystems, e.g. btrfs.
$ mkdir tmp $ df -hTP tmp/ Filesystem Type Size Used Avail Use% Mounted on /dev/vdb btrfs 7.0G 4.7G 1.7G 74% / $ ls -laid tmp 87645 drwxr-xr-x 1 rwcitek rwcitek 0 Feb 8 13:08 tmp $ ls -lai tmp total 0 87645 drwxr-xr-x 1 rwcitek rwcitek 0 Feb 8 13:08 . 87644 drwxr-xr-x 1 rwcitek rwcitek 6 Feb 8 13:08 .. Regards, - Robert On Tue, Feb 8, 2022 at 1:00 PM Steve Dum <dr.d...@frontier.com> wrote: > more importantly, doing > mkdir foo > ls -la foo > will show all the files in the newly created directory > That should be 2 namely . and .. > so 3,4, or 5 indicates you have that many directory entries. > lf "ls foo" shows nothing then there are 5 files starting with a dot. > so 3 more than just . and .. > steve > > Rich Shepard wrote: > > On Sun, 6 Feb 2022, Reid wrote: > > > >> That's the number of hard links. See section 10.1.2 of `info ls`. > > > > Ah, yes. That's familiar from a very long time ago that I had since > > forgotten. > > > > Thanks, > > > > Rich > > > >