Article 4YDCA Unable to remove symbolic link

Unable to remove symbolic link

by
susja
from LinuxQuestions.org on (#4YDCA)
I installed cygwin64 on my PC and then from terminal created some symlinks like this:
%ln -s /cygdrive/c /c
%ln -s /cygdrive/z /z
After that by mistake I created wrong link:
%ln -s /cygdrive/x /z
and
%ln -s /cygdrive/z /z
Then I realized it and wanted to remove 'x' and 'z' symlink but failed.
I have this picture:
pwd: /cygdrive/z
$ ls -l
total 58
drwxrwx---+ 1 VHA01+User(214401) Domain Users 0 Sep 23 16:28 abcLZ
-rwxrwx---+ 1 Unknown+User Unknown+Group 1404 Jan 13 22:20 'Shortcut to abcLZ.lnk'
-rwxrwx---+ 1 Unknown+User Unknown+Group 47104 Dec 13 15:06 Thumbs.db
lrwxrwxrwx 1 Unknown+User Unknown+Group 1 Jul 31 08:12 x -> z
lrwxrwxrwx 1 Unknown+User Unknown+Group 1 Jul 31 08:12 z -> z
--
pwd: /cygdrive/z
$ rm x
rm: remove symbolic link 'x'? yes
rm: cannot remove 'x': Permission denied
vhabhsvoldme@BOS-WSRES186018 /cygdrive/z
$ rm /cygdrive/z/x
rm: remove symbolic link '/cygdrive/z/x'? y
rm: cannot remove '/cygdrive/z/x': Permission denied
--
pwd: /cygdrive/z
/cygdrive/z
$ chown <myaccount> x
chown: cannot dereference 'x': Too many levels of symbolic links
***
Hence I'm stuck and can't remove symlink 'x' and 'z'. Could anyone please help me to get rid of it? Thankslatest?d=yIl2AUoC8zA latest?i=sBqpVzl0bvM:vT53BZfuDFI:F7zBnMy latest?i=sBqpVzl0bvM:vT53BZfuDFI:V_sGLiP latest?d=qj6IDK7rITs latest?i=sBqpVzl0bvM:vT53BZfuDFI:gIN9vFwsBqpVzl0bvM
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments