I have a directory that contains a link to another directory that I just created. I would like to remove the link but preserve the directory my link was pointing to. How do I do this?
> mkdir rgac
> ln -s /actual_dir_with_data/ /rgac/
directoryrmsymlink
I have a directory that contains a link to another directory that I just created. I would like to remove the link but preserve the directory my link was pointing to. How do I do this?
> mkdir rgac
> ln -s /actual_dir_with_data/ /rgac/
Best Answer
rm /rgac/actual_dir_with_data
should do nicely (you created a link probably calledactual_dir_with_data
in/rgac
). Don't worry,rm(1)
doesn't remove directories unless specifically told to do so. And you can then delete only/rgac
byrmdir /rgac
(seermdir(1)
).Probably what you wanted to do was
ln -s /actual_dir_with_data /rgac