Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?
share|improve this question
add comment

3 Answers

up vote 3 down vote accepted
  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: http://en.wikipedia.org/wiki/Symbolic_link

share|improve this answer
    
+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
add comment
  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.
share|improve this answer
    
"...it makes a different." Typo? "makes a difference" or "makes a different something"? –  Roger Pate Aug 23 '10 at 5:42
    
@Roger Pate: thanks –  txwikinger Aug 23 '10 at 22:01
    
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
add comment

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

Useage:

readlink [symlink]
share|improve this answer
    
You can also see this with ls. –  Roger Pate Aug 23 '10 at 5:41
add comment

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.