Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What is the difference between a Symbolic Link and a Shortcut?

share|improve this question

2 Answers

I think the important point is that shortcuts are just a file. They have a size (A small one, that just references where they point) and they require an application to support that filetype in order to be used.

A symbolic link is filesystem level, and everything sees it as the original file. An application needs no special support to use a symbolic link.

share|improve this answer
2  
Tree walking commands (anything like the unix utilities find, tar, du, etc) do need to know about symbolic links or they may do some very stupid things. For instance blinding following symbolic links can create cycles in the filesystem, and that is bad. – dmckee Mar 6 '11 at 20:50
5  
@dmckee; Very good point, while no application needs specific support to follow them, they do need specific support to not follow them! – Phoshi Mar 6 '11 at 21:19
Yes, don't need support to use them but do need to know about them. – dmckee Mar 6 '11 at 21:25
@Phoshi What exactly you mean by "and they require an application to support that filetype in order to be used.". Can you please explain with an example ? – Geek Dec 10 '12 at 13:48
1  
@Geek: A "shortcut" is effectively a file that holds the filepath of another file. When you read it, you read a specially formatted file that tells you where to look next. If your application doesn't listen, and simply reads the file verbatim, then you don't follow it. A symbolic link is filesystem-level, it's the filesystem itself that holds the "true" path to the data and when you attempt to access it, you retrieve the data pointed to. – Phoshi Dec 12 '12 at 13:12
show 1 more comment

A "Symbolic Link" can actually act like a substitute for a directory or file in a functional way, and is commonly used in Unix/Linux environments. Although there is apparently support for this in Windows, I haven't seen any actual use of it yet.

A "Shortcut" is just a regular file that has a reference to the destination file or directory along with some other things like the icon to be displayed. Unlike a Symbolic Link, you cannot "cd ./shortcut-name" in DOS (in Unix/Linux you can "cd ./symlink-name" and it will work just like a real sub-directory).

Also, in most Windows applications, when you click on a Shortcut in any File->Open GUI dialogue, your filename field gets populated with that shortcut's filename as well as it acting like a sub-directory, while in Unix/Linux the GUI treats a Symbolic Link as a path (without modifying the filename field).

share|improve this answer
In Unix/Linux there are also "Hard Links" which are only ever applied to files (not directories). These are natural filename entries in the file system that just happen to point to the same file data as another filename entry somewhere else (doesn't have to be in the same directory). – Randolf Richardson Mar 6 '11 at 17:05
3  
@Randolf: 1) Hardlinks exist in Windows too. 2) One feature of shell shortcuts is automatic target tracking – if the target is moved, most of the time shortcuts will continue to work. (In an AD domain it's even possible to track files over computers; for example, if you move a HD elsewhere.) 3) One use of symlinks is redirecting a file or directory to an alternate location – they can point to files (unlike junctions) and directories (unlike hardlinks), cross filesystems (unlike hardlinks), and, AFAIK, can even point to network locations. – grawity Mar 6 '11 at 17:46
grawity: Thanks! That's excellent information. – Randolf Richardson Mar 6 '11 at 18:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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