bug-fileutils
[Top][All Lists]
Advanced

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

Difference between cd and ls regarding symbolic links


From: Clark, Ben
Subject: Difference between cd and ls regarding symbolic links
Date: Fri, 25 Jan 2002 12:39:19 -0500

I noticed some strange symbolic link behavior while trying to build/install
jakarta-tomcat:
I don't know if this is a bug but here goes:

$ pwd
/tmp/test
$ ls
$ mkdir dir1
$ mkdir dir1/dir2
$ ln -s /tmp/test/dir1/dir2 /tmp/test/dir2
$ ls -Rl
.:
total 4
drwxr-xr-x    3 bclark   bclark       4096 Jan 25 12:25 dir1
lrwxrwxrwx    1 bclark   bclark         19 Jan 25 12:27 dir2 ->
/tmp/test/dir1/dir2

./dir1:
total 4
drwxr-xr-x    2 bclark   bclark       4096 Jan 25 12:25 dir2

./dir1/dir2:
total 0
$ cd dir2
$ pwd 
/tmp/test/dir2
$ ls -l ..
total 4
drwxr-xr-x    2 bclark   bclark       4096 Jan 25 12:25 dir2
$ cd ..
$ pwd
/tmp/test
$

How come ls .. does not list the contents of the directory I go to when I do
a cd .. ?




reply via email to

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