bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ls -Ll derefernce but does not print dereferenced name


From: Bob Proulx
Subject: Re: ls -Ll derefernce but does not print dereferenced name
Date: Thu, 23 May 2002 22:23:31 -0600
User-agent: Mutt/1.3.28i

> i found a probably bug in ls -L (dereference) today, take a look:

Thanks for the report.  But what you are seeing is not a bug.

> address@hidden /tmp]$ cd /tmp ; touch source ; chmod 000 source ; ln -s 
> source link
> address@hidden /tmp]$ ls -l link ; ls -l source ; ls -Ll link
> lrwxrwxrwx    1 magma    freebits        6 Mai 22 21:11 link -> source
> ----------    1 magma    freebits        0 Mai 22 21:11 source
> ----------    1 magma    freebits        0 Mai 22 21:11 link

> Why doesn't ls -L print the dereferenced name of the file the link is
> pointing? Any reason?

The behavior of -L is to dereference the symlink and report on the 
target of the symlink.  But the name is still the same name as you
referenced it the first time.  In other words it is doing what it is
supposed to be doing.  It is just not doing what you want it to be
doing.

> It would be great if it did it, because you can determine a file a
> link is pointing to without a extravagant...
>      ls -l | sed 's,.* -> \(.*\),\1,'
>                                           ...or something like that.

I think that would confuse a lot of people.  Ask it to list foo but
instead it lists bar?  I will sit back now and see what other people's
comments on this are.

Bob




reply via email to

[Prev in Thread] Current Thread [Next in Thread]