这更像是一种好奇心,但是我注意到/ etc / httpd / logs符号链接到/ var / log / httpd,但是当我在/ etc / httpd / logs里面时,我做了ls -la,我看到:
drwx------ 2 root root 4096 Mar 21 14:58 . drwxr-xr-x 9 root root 4096 Mar 17 03:10 ..
为什么不呢.入门秀lrwx ….?
但是当我去/ etc / httpd并做ls -la时,我看到:
lrwxrwxrwx 1 root root 19 Mar 4 17:12 logs -> ../../var/log/httpd
解决方法
我可以回答一个问题吗?假设你在这里安装RedHat / CentOS ……
ls /etc/httpd/ # should return something like: # conf conf.d logs modules run cd /etc/httpd/logs/ # Why does this next command fail? ls ../conf # ls: cannot access ../conf: No such file or directory # But this next command works? cd ../conf
简短的回答是当你在/ etc / httpd / logs(符号链接)内部时,你实际上在/ var / log / httpd里面,这是一个目录.
cd /etc/httpd/logs/ pwd # /etc/httpd/logs pwd -P # /var/log/httpd