How to remove a symbolic link to a directory?
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Take control of your privacy with Proton's trusted, Swiss-based, secure services.
Choose what you need and safeguard your digital life:
Mail: https://go.getproton.me/SH1CU
VPN: https://go.getproton.me/SH1DI
Password Manager: https://go.getproton.me/SH1DJ
Drive: https://go.getproton.me/SH1CT
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Game Looping
--
Chapters
00:00 How To Remove A Symbolic Link To A Directory?
00:25 Accepted Answer Score 136
00:39 Answer 2 Score 25
00:53 Answer 3 Score 16
01:12 Answer 4 Score 0
01:32 Thank you
--
Full question
https://superuser.com/questions/9181/how...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #bash #symboliclink
#avk47
ACCEPTED ANSWER
Score 136
Remove the trailing slash:
With prompt:
$ rm test5
Without prompt:
$ rm -f test5
ANSWER 2
Score 25
Try rm test5
(without the trailing slash).
The slash indicates that 'test5' is a directory whereas it's actually a file linking to a directory.
ANSWER 3
Score 16
You can run removing the trailing slash:
$ rm test5
This will remove the file (i.e. the symlink).
Alternatively you may use unlink:
$ unlink test5
Again you must omit the trailing slash since you are attempting to unlink the symlink not the directory.
ANSWER 4
Score 0
Sometimes if you use autocomplete to name the link that you want to delete you may not see a trailing slash but it's 'half there' and that invisible slash still gives the delete error when trying to remove that link.
So in that case type out character by character the link to be deleted as "test5" as eg. rm test5
.