MacOS – create a Desktop Shortcut/Alias to a Folder from the Terminal

aliasdesktopmacosterminal

I'd like to create a desktop shortcut to a specific folder, buried deep within ~/Library/. Library is Hidden by default in Lion, and I'd like to keep it that way, for a variety of reasons. Is there a one-step, command line action I can use, to create a desktop shortcut to a given path? I'd like to avoid solutions that involve unhiding the Library, creating the Alias using Finder, and rehiding it. I know how to do that, but for my purposes, a single line that can be pasted into Terminal and be done with it would be preferable.

Best Answer

Try this on Terminal:

cd ~/Desktop
ln -s ~/Library/path/to/folder