There seems to be an invisible symbolic link on my system.
First, I go to the
/var/www
directory and it shows nothing:# var/www# ls -la total 0
Next, I create a symbolic link and it is created successfully:
# var/www# ln -s /var/www/server/ /var/www # var/www# ls -la total 0 lrwxrwxrwx. 1 root root 16 Aug 23 22:51 server -> /var/www/server/
Note: There was no 'server' directory in
/var/www/
I remove the symbolic link:
# var/www# rm server # var/www# ls -la total 0
I create a server directory successfully:
# var/www# mkdir server # var/www# ls -la total 4.0K drwxr-xr-x. 2 root root 4.0K Aug 23 22:52 server
I try to create a symbolic link and get an error:
# var/www# ln -s /var/www/server/ /var/www/ ln: creating symbolic link `/var/www/server': File exists
I look for the symbolic link and it is not there:
# var/www# ls -la total 4.0K drwxr-xr-x. 2 root root 4.0K Aug 23 22:52 server # ls -la server/ total 0
The problem: Once I create the server
folder in /var/www/
I can no longer successfully create a symbolic link. I have also tried to find orphaned links with these commands:
find / -type l -exec ls -l {} \; > links.txt
and
find -L -type l > links.txt
... and I found nothing related to /var/www
.
I also tried:
strace ln -n -s -f /var/www/server /var/www
and it returned, in part:
write(2, "`/var/www/server' and `/var/www/"..., 57
/var/www/server' and
/var/www/server' are the same file) = 57
No luck. How do I delete the 'invisible' symbolic link?