This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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: 1396
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: 24189


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]
subject: delete soft link
It's not a secret anymore!