Solved Remove symbolic link from cygwin

January 24, 2020 at 11:48:33
Specs: Win 10, N/A
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? Thanks


See More: Remove symbolic link from cygwin

Reply ↓  Report •

#1
April 1, 2020 at 21:09:20
✔ Best Answer
Sounds like a permissions error. Try something like 'chmod a+w /cygdrive/z/x && rm /cygdrive/z/x'. Or perhaps 'chmod a+w /cygdrive/z/ && rm /cygdrive/z/x'.

Reply ↓  Report •

#2
April 1, 2020 at 23:08:14
Thanks for looking into it.
I already resolved the issue.
The problem was with server permission

Reply ↓  Report •
Related Solutions


Ask Question