Asked • 05/14/19

Remove a symlink to a directory?

I have a symlink to an important directory. I want to get rid of that symlink, while keeping the directory behind it. I tried `rm` and get back `rm: cannot remove 'foo'`. I tried `rmdir` and got back `rmdir: failed to remove 'foo': Directory not empty` I then progressed through `rm -f`, `rm -rf` and `sudo rm -rf` Then I went to find my back-ups. Is there a way to get rid of the symlink with out throwing away the baby with the bathwater?

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.