Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Also, symlinks have permissions like normal files, but the operating system doesn't consult them, it consults the permissions targeted file instead to decide behavior. And, don't do circular chains of symlinks. Very bad. Commented Mar 18, 2011 at 19:01
  • 3
    Is it really very bad? What will happen? The most excitement I'm able to recreate is "Too many levels of symbolic links" error messages. Commented Mar 18, 2011 at 19:05
  • 1
    ls -l is enough to see what is being linked by a symlink, the a stands for --all, see manpage. And even if symlinks work at the file system, there are alternative functions to use symbolic links as files instead of follow. Commented Mar 18, 2011 at 19:37
  • 4
    Windows shortcuts are actually quite different from symlinks: they follow their target, and they are also regular files. (Windows also has symlinks, but they're not used much.) Symlinks are purely textual, the target text is read whenever you access the file. Whether symlink permissions matter depends on the OS and filesystem. Commented Mar 18, 2011 at 20:04
  • AFAIK, the content of a symlink file is the path the symlink points to, which can be seen when looking at the size of the symlink file: ln -s /home 1; ls -l 1 shows that the symlink 1 is 5 bytes long, whereas ln -s /usr/share/ 2; ls -l 2 showas that 2 is 11 bytes long. Commented Jan 20, 2012 at 17:48