How to Make a Symbolic Link
The basic syntax for creating a symbolic link (or soft link) is as follows:
ln -s /path/to/original/ /path/to/link
That will point /path/to/link to the original location, in this case /path/to/original/
For example, to create a symbolic link for the user Downloads folder which links it to a directory on a separate mounted drive, syntax may look like the following:
ln -s /Volumes/Storage/Downloads/ ~/Downloads/
That will link the active users ~/Downloads/ folder to a directory named “Downloads” on the mounted drive called “Storage”. If such a directory and drive existed, this would basically allow all files that would typically appear in the user downloads folder to go to the other mounted volume instead, essentially offloading the storage burden to that separate drive, while still preserving the appearance of a ~/Downloads/ folder for the user. As mentioned before, this behaves much like an alias.
Another example would be to offer easier access to an otherwise buried binary by linking the command to /usr/sbin/
sudo ln -s /A/Deeply/Buried/Path/ToApp.framework/Resources/command /usr/sbin/commmand
This would allow the user to type ‘command’ and access the binary, without having to prefix the command execution with the entire path.
How to Remove a Symbolic Link
Of course, created symbolic links sometime need to be undone. This is easy with rm, or by using the ‘unlink’ command as follows:
Essentially this is removing the tiny file (again, like an alias) that references the symbolic link to the original item.
Unlinking a symbolic link will not delete any files or folders other than that defined link, it simply removes the reference from the linked item to the original item.