Can't Make Symbolic Links

Joined
Sep 25, 2011
Messages
52
Reaction score
0
Points
6
Location
San Antonio, TX
Your Mac's Specs
MacBook Pro 13"(Early 2011) 2.3 Ghz Intel Core i5 Mac OS X 10.8.2
Ok, so a couple of weeks ago I finally got around to upgrading to Mountain Lion, the installation went without a hitch, but a couple days later I realized that I can't make symbolic links anymore. If I make a link in the same directory as the original file, the link is perfect and works without a problem, but if I make it in another directory...problems start.

As an example, if I symlink ~/Sites to Desktop/Sites just for the **** of it, ls -l returns

Code:
lrwxr-xr-x  1 Vincent  staff  6 Jan 12 01:10 Sites@ -> Sites/

Everything good so far, but as soon as I try to cd into it I get

Code:
Sites: Too many levels of symbolic links.

Yet if I symlink ~/Sites to ~/Example, I can cd into it with no problem.

This has been really driving me crazy cause I symlink everything into my Dropbox folder. I'm using tcsh as my shell and iTerm2, though I've tried using bash and Terminal.app to see if that can fix this problem. Thanks in advance to anyone who can help
 
OP
Hexen
Joined
Sep 25, 2011
Messages
52
Reaction score
0
Points
6
Location
San Antonio, TX
Your Mac's Specs
MacBook Pro 13"(Early 2011) 2.3 Ghz Intel Core i5 Mac OS X 10.8.2
Never mind, I was reading A Practical Guide to Linux and happened to see something about symlinks, it turns out that I just needed to use absolute path names instead of relative ones.
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
It is always better to use absolute pathnames - especially if you are doing symbolic links. You can still you relative paths if you use the . before it

Code:
cd ~/Desktop
ln -s ~/Sites ./Sites
would put a symbolic link on the Desktop - without having to type in the whole desktop path. Of course I told you all this for your own edification - I would still recommend using absolute paths for everything so that you know exactly where your target and link are going to end up.
 
OP
Hexen
Joined
Sep 25, 2011
Messages
52
Reaction score
0
Points
6
Location
San Antonio, TX
Your Mac's Specs
MacBook Pro 13"(Early 2011) 2.3 Ghz Intel Core i5 Mac OS X 10.8.2
I will definitely use absolute path names whenever I'm trying to link something from here on out...it's just weird cause I don't remember ever having to use absolute path names before--maybe I just wasn't paying attention. Oh well, problem solved and lesson learned.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top