Description of problem: "ls .." shows different directory content than "cd .. ; ls" when the current directory is a symlink, pointing to another directory. This will create confusion for an average user who is not aware of the fact that the current directory is a symlink. Version-Release number of selected component (if applicable): 4.5.3-19 How reproducible: Steps to Reproduce: 1. say I've a directory as /path1/foo & another directory as /path2 2. making a new symlink to /path1/foo $ cd /path2/ $ ln -s /path1/foo/ bar $ cd bar /path2/bar $ 3. now executing the command "ls .." shows the content of the parent of target directory (content of /path1, & not of /path2) $ ls .. foo while "cd .." will lead me to /path2 $ cd .. $ pwd /path2 $ ls bar $ .... this seem to be an inconsistency, considering the situation where a user is not aware of that 'bar' is actually a symlink, what he sees is a completely different output from seemingly trivial commands. Actual results: "ls .." & "cd .. ; ls" show different directory contents. Expected results: The contenst shown by "ls .." should be the content of the parent directory of the symlink... Additional info:
No, this is correct behaviour. Use 'cd -P' to prevent confusion. When you have used 'cd symlink', the 'parent' directory (the one you were just in) is only known to bash, and not to ls.