The moose likes Linux / UNIX and the fly likes delete soft link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "delete soft link" Watch "delete soft link" New topic

delete soft link

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1427
How to delete only soft link without deleting directory and its contents. unlink deletes soft link and directory too.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199


No, deleting a soft link deletes only the link. If you have a link to a directory and you just say "rm link", then the link is removed. If you say "rm -rf link", though, then yes, the whole linked-to directory will be emptied out.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: delete soft link
It's not a secret anymore!