I have a /usr/tomcat6/logs
directory linked to /var/log/tomcat6
.
When I changed directory to /usr/tomcat6/logs
and try to ls
files using a relative pathname ../conf/Catalina/localhost
, a No such file or directory error occurs. However, cd ../conf/Catalina/localhost
works.
See the following:
[root@fedora ~]# ll /usr/tomcat*
lrwxrwxrwx. 1 root root 21 Jun 17 15:00 /usr/tomcat6 -> apache-tomcat-6.0.32/
lrwxrwxrwx. 1 root root 21 Jun 17 13:03 /usr/tomcat7 -> apache-tomcat-7.0.16/
[root@fedora ~]# cd /usr/tomcat6
[root@fedora tomcat6]# ll logs
lrwxrwxrwx. 1 root root 16 Jun 17 14:51 logs -> /var/log/tomcat6
[root@fedora tomcat6]# cd logs
[root@fedora logs]# cd ../conf/Catalina/localhost
[root@fedora localhost]# pwd
/usr/tomcat6/conf/Catalina/localhost
[root@fedora localhost]# cd /usr/tomcat6/logs
[root@fedora logs]# ll ../conf/Catalina/localhost
ls: cannot access ../conf/Catalina/localhost: No such file or directory
How could this happened? Is it a bug or special behaviour of symbolic link?
cd
command is taken care of about it's argument, others are not been taken care of (ls ../conf
failed,[[ -e ../conf ]]
failed,test -e ../conf
, etc ...)? – LiuYan 刘研 Jun 20 '11 at 04:07cd
and the relatedpushd
. – geekosaur Jun 20 '11 at 04:13