I've used rsync to transfer a file from a local machine to the remote. The intended way of destination was /usr/share/nginx/html, however in the file name there is an additional line mentioning a different path -> /usr/share/nginx/mario/desktop/'. I have no idea what it means?

terminal snapshot


The file is a symbolic link or symlink pointing to /usr/share/nginx/mario/desktop. It has no content of its own - just a name and location, and a location that it points to. This information is stored in the filesystem (in inode tables), rather than inside the file itself.

If you open a symlink, you will see the contents of the file* it points to (we say the program follows the symlink to the target it points to)

Any program that reads files in this directory will also read the file pointed to by the symlink. This is often really helpful and space-saving, because multiple copies of the file don't have to exist if symlinks from other directories can point to them and programs and users can find what they need.

Here /usr/share/nginx/mario/desktop/ is the 'real' directory pointed to by the symlink. If you copied a symlink, then it should be pointing to the same place it was before (it's just a text string so it will not be changed by copying) and the symlink is not broken now (because it's showing up turquoise and not red) so to investigate you should check the target directory /usr/share/nginx/mario/desktop and the original file /Users/ogorod/Desktop/f6c594012317.html

*in Linux, everything is a file even if it's a directory ;)


The file /usr/share/nginx/html/f6c594012317.html is not a real file but a symlink (symbolic link).

That means if you access this file, your access gets redirected to the link target.

In this case, the link target is the directory /usr/share/nginx/mario/desktop/, so the "file" will behave like a directory.

  • Why did this happen? I was willing to transfer a file using rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress /Users/ogorod/Desktop/f6c594012317.html root@ – user3551334 Jul 17 '16 at 14:01
  • Probably the original file already was a symbolic link? Symbolic links point to a literal path. You can tell rsync to copy the target file instead of a symlink though using the -L option. – Byte Commander Jul 17 '16 at 14:10
  • Correct. I was copying a symbolic link (not a file) without knowing that. Do you have any idea of why ubuntu set exactly this path "/usr/share/nginx/mario/desktop/"? – user3551334 Jul 17 '16 at 14:15
  • Sorry, I don't know why that file name which suggests to be a html file links to that directory. I can't really imagine that Ubuntu set it up this way on its own. Maybe you did that accidentally...? – Byte Commander Jul 17 '16 at 14:18

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.