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.
me$ ln -s ~/x/y/ ~/Desktop/
ln: /Users/me/Desktop//: File exists

Why does this attempt at creating a symbolic link to ~/x/yon the Desktop now work? The only way I can seem to get something like a symbolic link is this way:

ln -s * ~/Desktop/

I'm confused, this was really simple in Ubuntu.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

Alternatively, you can do

ln -s ~/x/y ~/Desktop/

(note there's no slash '/' character after ~/x/y/).

I think the error message is not the most informative, but I understand it as that if you're putting a trailing slash, you're referring to the content of your directory (in this case ~/x/y), but if you omit it, you're referring to the directory itself.

share|improve this answer
1  
Of course this one doesn't. You've done ln -s ~/Desktop/symlink ~/Desktop/ which makes a symlink onto itself (there already is a ~/Desktop/symlink file in there, you can't link it to itself). If you do ln -s ~/tmp/symlink ~/Desktop/ it should work. –  mike Oct 27 '13 at 20:36
    
Hmm, now it lets me make the symlink, but the symlink shows the default file icon (instead of the folder icon) and attempting to open the symlink shows an error –  George Garside Oct 27 '13 at 20:39
1  
Again, can you paste in the commands and their output exactly as you've typed them? Difficult to tell without seeing them. –  mike Oct 27 '13 at 20:56
1  
Here's my Terminal output. Getting the same error as @Tor when attempting to open symlink. –  George Garside Oct 27 '13 at 20:57
1  
Hmm... I'll be honest with you. I've done the exact same thing on my system (OSX 10.9) and it works perfectly... beats me! –  mike Oct 27 '13 at 21:01
show 3 more comments

ln -s ~/x/y/ ~/Desktop/ attempts to symlink ~/Desktop/ to ~/x/y/, which does not appear to be what you wanted, and is indeed not possible since ~/Desktop exists (as the error states).

To create a symlink to ~/x/y/ inside ~/Desktop/, you need to give it a name like so:

ln -s ~/x/y/ ~/Desktop/mysymlink

This creates a symlink mysymlink on your desktop that links to ~/x/y/.

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.