ls -l is not behaving as I expect

Nils Kassube kassube at gmx.net
Thu Feb 3 09:52:57 UTC 2011


Tapas Mishra wrote:
> On Thu, Feb 3, 2011 at 12:54 PM, Nils Kassube <kassube at gmx.net> wrote:
> > Tapas Mishra wrote:
> >> It is a very silly thing but I now have to ask there is a folder
> >> which is not having any directories but when I do an ls -l from
> >> its parent directory
> >> I just see following
> >> ls -l www/claroline/
> >> total 0
> >> 
> >> I expect a long format to be displayed for permissions with
> >> respect to this directory why is that not happening.
> > 
> > From "man ls":
> > | NAME
> > |        ls - list directory contents
> > 
> > You asked ls to list the contents of the directory www/claroline/
> > which it did. If you want to list the entry for that directory,
> > try "ls -ld www/claroline/" instead.
> > 
> > 
> > Nils
> 
> From man ls for
> "       -l     use a long listing format"
> So why did -l did not worked when I gave that option?

But it did work. The -l option designates the long format but not what 
to list. The long listing format of an empty directory is only the total 
size of the files listed, which is of course 0 because there are no 
files. However the -d option changes the items to list from the 
directory contents to the directory entry.


Nils




More information about the ubuntu-users mailing list