Symbolic Link vs. Alias

Discussion in 'Mac Basics and Help' started by g-boac, Jan 22, 2012.

  1. g-boac macrumors 6502

    Joined:
    Oct 7, 2007
    #1
    Hi - can somebody explain to me the difference between symbolic links and aliases? Especially any pros/cons of each, and under what circumstances I would want to use one over the other (and vice versa)?

    I know that Mac OS X by default creates an alias when you hold down the command-option keys while dragging a file. . .but beyond that, I don't know why or the difference between the two. Any insights, and examples why/when you use one (or WOULDN'T use one) vs. the other help!!

    thanks!!
    Mark
     
  2. dusk007 macrumors 68040

    dusk007

    Joined:
    Dec 5, 2009
    #2
    Well a symbolic link is a filesystem function Alias is more of a special kind of file.

    -s links are one way street point to a location regardless of what is there or if that changes. If you rename the destnation folder it points to nothing. If rename some other folder to the right name it now points there. A symlink in terminal will be understood just like a hard link.
    Uses the icon of the original folder, file ..

    Alias is a two way stree it points to the file not its location like a hard link.
    You move the file (on the same partition) the alias won't break.
    Alias can use its own icon. Alias doesn't work in the command line.

    There are also hard links which are effectivly true addresses. The hard link "is" the file, just that there can be multiple hard links from different locations point at the same file. As long as one hardlink lives the file is not deleted.
    It is basically a way to break the usual folder structure.

    For the Movies, Music .. folders I would just use symbolic links. I never really tried what happens to a hard link if it points to a drive that isn't mounted currently.
     
  3. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #3
    Hard links can't cross devices. All hard links to a given file must be on the same disk or partition volume.

    http://en.wikipedia.org/wiki/Hard_link
     

Share This Page