I'm puzzled by ls -l output for the /media directory and realised I don't fully understand what the ls long output columns show. The ls man page did not help. Here's the puzzling output
root@CW8:/media# ls -ld README hd* dvd*
-rw-r--r-- 1 root root 500 2006-09-26 08:44 README
lrwxrwxrwx 1 root root 4 2010-02-21 15:18 dvd -> dvd0
drwxr-xr-x 2 root root 1 2006-09-26 06:20 dvd0
drwxr-xr-x 2 root root 1 2006-09-26 06:20 dvd1
lrwxrwxrwx 1 root root 3 2010-02-21 15:18 hd -> hd0
drwxr-xr-x 2 root root 4096 2010-03-15 11:13 hd0
drwxr-xr-x 2 root root 1 2006-09-26 06:33 hd1
What does the second column mean? I thought it was a hard link count but
root@CW8:~# find / -xdev -samefile /media/hd0
[no further output]
The fifth column is the size of the file in bytes. That's why README is listed, to show that's reasonable.
symlinks dvd and hd have fifth column (spies!) figures the size of their target names. Reasonable but aren't such short names kept in the directory entries (dirents) themselves so such symlinks are not files; their file size should be zero ???
Regards the directory file sizes being 1 or 4096, a few files were written to hd0 while no file system was mounted on it. Presumably that made it grow to accommodate dirents and it went from being a dirent alone to being a dirent plus an inode so it had space to store dirents for its own files. The reported 4096 presumably represents this single inode. But why are the other directories' sizes 1? If my speculation is correct, these directories which have only ever been used as mount points so have never "contained any files" are implemented purely in dirents in their parent' directory -- so, like symlinks with short target names, they are not files; their file size should be zero ???