I was trying to create a symbolic link using the following command:
ln -s "~/Foo Bar/" Foo
... but it didn't work (i.e. when I go into finder and try double clicking it, it says that it's pointing to an invalid path and prompts me to delete the alias or fix it). I had to rename the folder to FooBar
and then run the following command:
ln -s ~/FooBar/ Foo
How can I create the link without having to remove the space from the folder's name?
I'm looking for a way to do this in Terminal and not in Finder's UI.
ln -s
makes symlinks. The Finder makes aliases. They are almost identical in practical, common use, but it's important to recognize that they are different. Symlinks point to a directory path, while aliases point to a file. If you have both pointing to the same file and you move the file to a different folder, then make a new file in the old folder, the alias will point to the moved original and the symlink will point to the new file. – Cajunluke Feb 17 '11 at 20:46ln -s ~/Foo<tab>
(where <tab> denotes the actual ⇥ (tab) key on your keyboard), if there is only one folder that starts with "Foo" in~
then it will automatically expand the path to~/Foo\ Bar/
. – Jason Salaz Feb 17 '11 at 23:40