[CentOS] Strange symbolic link behaviour?

Tue Jul 5 09:52:47 UTC 2011
Giovanni Tirloni <gtirloni at sysdroid.com>

On Tue, Jul 5, 2011 at 2:21 AM, Emmanuel Noobadmin
<centos.admin at gmail.com>wrote:

> On 7/5/11, Eric B. <ebenze at hotmail.com> wrote:
> > The strange behaviour here is when listing the parent directory (..).
> > In this case, ls .. is listing the contents of Mail/ directory - not
> > /home/eric.
> >
> > In the past, I always recall being able to use the parent identified
> > (..) to move up one level in the directory structure whether in a
> > symlink or not.  In this case, I would have expected ls .. to list the
> > contents of /home/eric - not /home/eric/Mail.
>
> I believe it's normal. If I'm not mistaken, cd works based on the
> working path i.e. /home/eric/test so cd .. goes to /home/eric
>
> However ls works by reading the .. inode of the directory you're in,
> which will always point to the real parent /home/eric/Mail no matter
> how you got to that directory.
>
>
That's correct and it's the behavior most people seem to prefer.

To change it use `set -o physical` in Bash.

-- 
Giovanni Tirloni
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20110705/eff7b9ec/attachment-0005.html>