access to folder shortcut

Discussion in 'Mac Programming' started by chrislee8, Aug 18, 2006.

  1. chrislee8 macrumors regular

    Jul 26, 2004
    NY, NY
    I created a shortcut for a folder at my desktop, the icon has a little curve arrow on it.

    in a terminal (bash), I try to do >cd myfolder, it doesn't get into the folder, what do i need to do?

  2. WildCowboy Administrator/Editor


    Staff Member

    Jan 20, 2005
    Okay, I'm not a Unix expert (though I should be...I use it enough). The problem you're having is that the shortcut (alias) is not an actual folder, so you can't cd into it. I'm not aware of a way to activate the alias within Terminal to take you to the desired folder...but don't quote me on that.

    What you can do is create a Terminal alias and save it to your .cshrc. There's some info on how to that here.
  3. chrislee8 thread starter macrumors regular

    Jul 26, 2004
    NY, NY
    i thought there would be a more convenient way to do that.

    oh well, thanks though
  4. jsw Moderator emeritus


    Mar 16, 2004
    Andover, MA
    The Finder->File->"Make Alias" command is really GUI-only - the actual file is more or less worthless in Terminal.

    However, you can make a "real" alias by opening Terminal, typing in
    ln -s
    (be sure there is a trailing space), then dragging the folder into Terminal, which will enter the path, so you'll have something like
    ln -s /Users/me/Desktop/Stuff 
    There will be a trailing space. Finish it with the new location, remembering the path, so it'd end up being a command like:
    ln -s /Users/me/Desktop/Stuff /Users/me/Documents/StuffAlias
    Press return.

    That'll do the trick; the second name is the alias - it'll be usable via Terminal as well.
  5. gnasher729 macrumors P6


    Nov 25, 2005
    What you have created is an alias file. An alias file is just a normal file, however, instead of normal data it contains a description where another file or folder can be found. The finder and many applications will read that description and find the right file or folder doing this. Because it is nothing within the file system, alias files "work" for example if you copy everything to another disk, or rename a folder, and so on.

    Another method in Unix is to create a "symbolic link". A symbolic link contains a direct connection to another file or folder. In terminal, do "man ln" to see the command that creates unix links. The finder will display unix links exactly the same as alias files. Usually, alias files are the preferred method, because they survive more user actions without problems; a symbolic link will stop working if you move or rename the folder it is pointing to.
  6. kainjow Moderator emeritus


    Jun 15, 2000
    I hope Tiger's Finder abandons the alias and uses symbolic links instead.
  7. chrislee8 thread starter macrumors regular

    Jul 26, 2004
    NY, NY
    I sorta remember that when i was playing with linux. thanks

Share This Page