When exploring directories from a symlink (symbolic link) using Nautilus or Gnome Commander, the directory structure is displayed as if the symlink were a regular directory. When I open a document, apps differ in how they treat the path. For an .html document:

  • opened w/ Firefox: Shows the real path as the address
  • opened w/ NetBeans: ditto
  • opened w/ Gedit: Shows the symlink path as the address

  1. Do I need to pay attention to these varying behaviors?
  2. I feel insecure when the symlink path is offered (because of my Windows background) -- can I ignore that? Can I proceed with confidence, and if so, does that cover all cases?
  3. An app will occasionally ask me if I want to preserve symlinks, treat symlinks as actual links, and so on. (ex., copying in Gnome Commander presents an option called "follow links" ... which I assume means symlinks). Your guidelines for that?
  1. Not really, because either way you are still viewing/editing the files that the symlink is pointing to

  2. When the symlink path is given, I think it means that the application thinks that the file is at that path; however, the data is still being read from/written to the same place in the file system (the original file). So yes, you can ignore it.

  3. 'Preserving symlinks', in my understanding, means that when you move a symlink file and it points to a relative path, the relative path will be adjusted so that it still points to the same file. It is probably a good idea to preserve symlinks. 'follow links' means that the action you are doing (such as copy) is done to the linked to files and all the files within the linked to directories. I think that if you follow links when copying, the actual files/folders will be copied to the new location. If you don't follow links, only the link is copied to the new address.

This wikipedia page has a detailed explanation of symlinks

  • +1. You should quote each question before you answer it - will be more readable.
    – Umang
    Aug 22 '10 at 16:38
  • 1
    I thought the use of question numbers was adequate, myself.
    – Smandoli
    Aug 22 '10 at 19:48
  • Thanks, helpful answer. I have looked at the wikipedia article before, but I think it seemed too techie (as well as others I found) -- today it seemed to get more clear as I pressed on.
    – Smandoli
    Aug 22 '10 at 20:02
  1. This might be a two-sided sword. In some way, for a casual user, the indication of a symlink might be confusing, while for an advanced user might be important. Maybe it would be good if those file browsers would have a configuration option that could make them give the functionality that is needed.
  2. Not sure what you are insecure about. If you follow a symlink, it is not different as if it would be a normal path. It gives you additional flexibility in that you can change directories or files that are used. It is like an alias. Several names for the same thing.
  3. When you copy a tree of directories, it makes a difference. You can either ignore all symlinks, and only copy all "real" directories or files, or copy the symlinks as symlinks, i.e. copy exactly the same, or duplicate the trees (or files) that are behind symlinks to distinct copies.
  • "...it makes a different." Typo? "makes a difference" or "makes a different something"?
    – Roger Pate
    Aug 23 '10 at 5:42
  • When changing a file, knowing about symbolic links is important! Suppose I have ./file -> /etc/hosts. If I edit ./file, I'll see the contents of /etc/hosts, but when I save, the symbolic link will be broken (I don't have write access to /etc/hosts), and I'll end up with my own copy of ./file, which will no longer track changes to /etc/hosts.
    – waltinator
    Nov 14 '11 at 18:41

Also the commmand readlink might also come in handy from the terminal if your ever unsure about were a particular symlink is directed to.


readlink [symlink]
  • You can also see this with ls.
    – Roger Pate
    Aug 23 '10 at 5:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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