Click to See Complete Forum and Search --> : ls -l output question...


BigCletus
10-12-2001, 02:53 PM
When ls -l is printed, what is the number to the left of the owner signify?

total 20
-rw-r--r-- 1 root root 308 Oct 11 22:43 bomb.gif
-rw-r--r-- 1 root root 286 Oct 11 22:45 index.html.clint
-rw-r--r-- 1 root root 2890 Mar 29 2001 index.html.original
-rw-r--r-- 1 root root 0 Oct 11 23:51 ls.txt
drwxr-xr-x 3 root root 4096 Oct 11 14:58 manual
lrwxrwxrwx 1 root root 23 Oct 11 22:45 pie1.gif -> /var/www/icons/pie1.gif
-rw-r--r-- 1 root root 1154 Mar 29 2001 poweredby.png
lrwxrwxrwx 1 root root 5 Oct 11 22:49 root -> /root
lrwxrwxrwx 1 root root 4 Oct 11 22:50 usr -> /usr

thanks

AdaHacker
10-12-2001, 03:11 PM
That's a very good question. I've always wondered what that meant too. According to the man page, it's the "number of links". What THAT means, I have no idea. You would think it was the number of symlinks or something, but it doesn't seem to be.

Joeri Sebrechts
10-12-2001, 03:56 PM
According to 'info ls':

`-l'
`--format=long'
`--format=verbose'
In addition to the name of each file, print the file type, permissions, number of hard links, owner name, group name, size in bytes, and timestamp (by default, the modification time).

A hardlink is a physical link to a file, contrary to a softlink, which is what most people call symlink. You can create an extra hardlink to a file with the ln command, by not using the -s option. That way if you create a file foo, then make a hardlink to it called bar, and delete foo, bar will still point to your file. Deleting a file doesn't actually delete the file, just the hardlink you gave as argument to the delete command.

Now, as for why you would want to know this, that's something entirely different
:)