MacOS – Symlinking /User/SpecialFolder to different drive creates Folder in Folder

findermacossymlink

Just finished re-installing macOS Sierra on my MBP and am trying to move the ~/Downloads and other folders to a different drive so they end up in /Volumes/Data/ instead.

I created a /Volumes/Data/Downloads folder and symlinked from one to the other like so:

sudo ln -s /Volumes/Data/Downloads Downloads

This works more or less, but it creates another Downloads folder inside the /Volumes/Data/Downloads folder so the full path would be

/Volumes/Data/Downloads/Downloads

Any Idea what I'm doing wrong?
So it looks like this:
Downloads inside Downloads

Best Answer

This occurred because you already had something in your home directory called "Downloads" - the ln command is smart enough not to write over it, so instead created the symlink within it.

If you're starting from scratch you can mv ~/Downloads ~/Volumes/Data/; if you've already successfully copied your Downloads directory you can simply delete the old one in your home directory: rm -Rf ~/Downloads.

After that your original ln command should work. You shouldn't need to prefix it with sudo:

ln -s /Volumes/Data/Downloads ~/Downloads

Or, as fd0 suggested, instead of using rm you could use ln -s -f option to unlink the directory. Thus creating the desired results:

ln -s -f /Volumes/Data/Downloads ~/Downloads