Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I realized today that an alias is not the same thing as a soft link in Lion. I made an alias of a folder in my Dropbox folder and moved the alias to my Desktop.

When I try to cd into this alias in terminal, the terminal notes that the alias is not a folder. In Ubuntu, I can, however, cd into a soft link.

How can I create a soft link in Lion? It would be convenient for me because I write python scripts that rely on soft links.

share|improve this question
add comment

2 Answers 2

up vote 8 down vote accepted

You can create soft links (a.k.a. symbolic links or symlinks) from the terminal, the same way as in any other Unix system.

I'm not familiar with Dropbox so I'll make up an example assuming that there is a folder Dropbox in your home directory:

cd ~
ln -s ~/Dropbox/aFolder Desktop/aFolder

Note that ln takes the link to create as its second argument; think of it like cp.

Also, a warning: if you create a soft link with a relative path, for example

cd ~/Desktop
ln -s ../Dropbox/aFolder aFolder

then the link will be relative to its location at the moment, not to the current directory when you created it! So, for example, if you moved it into ~/Desktop/Folders then it would be pointing at ~/Desktop/Dropbox instead of ~/Dropbox.

share|improve this answer
add comment

You must use the Unix ln command from Terminal.

ln -s existingname newname
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.