There is an existing directory, say, dir. I want to remove it and create a symlink dir to another directory. So I know I can just do rm -rf dir and then ln -s /path/to/that/directory dir. Is there a way to do it with ln without having to rm? I didn't see an appropriate help when I did ln --help.


1 Answer 1


No such functionality exists.

It's also really sensible that it doesn't: to make that symlink, something of the same name mustn't exist so far. Integrating that deletion functionality into every single program that might create something new makes no sense: Just run rm.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .