View Single Post
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2009-11-21, 15:56

Quote:
Originally Posted by turtle2472 View Post
Does anyone know how this can be done? Please.
Sorry I didn't catch this earlier.

Code:
ln -s sourcefile targetfile
So, if you have file ~/Documents/MyFile and you want to create ~/Desktop/LinkToMyFile, you'd do:

Code:
ln -s ~/Documents/MyFile ~/Desktop/LinkToMyFile
Of course, if you're on a Mac, you could simply create an "alias" in the Finder with File -> Make Alias. There are some subtle but important ways symlinks and aliases differ. Since aliases are "a Mac thing", command line utilities don't respect them. Since symlinks are "a unix thing", some Mac apps won't distinguish them from the original file or worse will think they are unrelated separate files, but most modern ones will have them appear like aliases.

Here's how they differ at the command line. In this example, A is the original file (just a blank file), B is a symlink of A, and C is a Mac alias of A.

Code:
-rw-r--r-- 1 bradsmith staff 0B Nov 21 15:52 A lrwxr-xr-x 1 bradsmith staff 1B Nov 21 15:52 B -> A -rw-r--r--@ 1 bradsmith staff 47K Nov 21 15:52 C
Neat, huh? The @ symbol means there are extended filesystem attributes on that file, which is to be expected since that's how Mac aliases work. And in the Finder:


The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote