Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
What is the difference between NTFS hard links and directory junctions?

What's the difference between them? in examples..

share|improve this question

marked as duplicate by Arjan, quack quixote May 30 '10 at 0:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2  
dupe. There is already a pretty good answer here: superuser.com/questions/67870/… –  Leftium May 20 '10 at 10:51

2 Answers 2

up vote 20 down vote accepted

The easiest way for most people to understand a symbolic (or soft) link is to think of it as a Windows shortcut.

If you make a symbolic link to a file, when you open it, Windows goes and looks up the original file in the filesystem index and then opens it. You can think of the symbolic link as being a signpost to the original file.

A hard link is an extra entry in the filesystem index that points to the same location on the disk as the original file's name. Think of the original name and the hard link as two doors into the same room.

A junction is a symbolic link to a folder (I think this is a hangover from previous versions of Windows and is now obsolete - I presume, but I haven't checked, that you can just use hard links now).

share|improve this answer
12  
+1 for two doors into the same room –  Nifle May 16 '10 at 13:07
    
Should get a −1 for » hard link to a folder «, though. –  Joey May 17 '10 at 8:26
    
Oops, yes they are symbolic not hard links, I've amended accordingly. I see that the new mklink command still supports creating junctions as well as hard and soft links, but can see no reason for using a junction rather than a link. –  Neal May 17 '10 at 15:25
    
Actually, the documentation does say that hard links can be applied to a folder, it's just a matter of time until someone figures out how to do it. –  Hello71 Jul 20 '10 at 20:08
6  
Junctions are not obsolete and hard links cannot replace junctions as a hard link can only point to a target on the same partition (drive) but a junction in one partition can point to a target in another partition. I found the descriptions in this post very useful. –  orad Jan 20 '13 at 23:48

Directory Junction is "symlink to directory", so you can create "access points" to folders, available since NTFS 5.0 (Windows 2000). Directory Junction is NOT "a hard link to a folder", because junctions can point to non-existent directories. Directory and its junctions can be located on different NTFS partitions, but not across LAN. Non-elevated admins & user can create junctions.

NTFS Symbolic link was added to NTFS in Windows Vista. Symbolic link can point to a file or a directory (compare with junctions). Using them you can create "access points" to files & folders on different NTFS partitions AND across LAN. "The default security settings in Windows Vista disallow non-elevated administrators and all non-administrators from creating symbolic links."

"Symbolic link to directory" vs "Directory Junction" - by my experience, some (many?) apps does not work correctly with symbolic links, but they are fine with junctions, e.g. Total Commander and Windows file sharing (for LAN). If you share a directory with symlink - LAN users cannot traverse it, but they can do it for junctions. So after high-quality thing in Win2k, MS implemented some shit in Vista...

Hard links can point to files only in the same partition, there is absolutely no difference between first file instance and other hard links to the same file. If you delete some hard link (first instance or another), file will continue to exist unless last hard link is deleted.

Junctions & symbolic links can be "broken" - it you rename/move the target, then they will point to non existent target. So you need to update they in such cases. But hardlinked files can be renamed/moved and all hardlinks will still be the same file, just with different names.

share|improve this answer
    
±1 here, +1 for correctly pointing out that a directory junction isn't a hard link, −1 for the third paragraph which goes way downhill. (For the record: Far can traverse directory symlinks just fine; maybe you're just using a broken OFM :-).) –  Joey May 17 '10 at 8:33
1  
Note to add: Hard links can point to files on the same volume which isn't the same as a partition (a partition is a section of an individual drive, a volume can span many of those and even multiple drives; a volume is what the file system is on, not a partition). –  Joey May 17 '10 at 8:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.