[LBo] Symlink peculiarities

Anerobe anerobe at yahoo.com
Sun Jan 7 20:03:13 CET 2007


This may be a bit late, but I wanted to share some peculiarities with
symbolic links I've run across ? maybe they are specific to my system ? or
maybe not.

I wanted to create symlink on my Desktop to a document in my ?documents?
folder. When I first created a symlink on my Desktop, the link icon was
padlocked, and the link was ineffective. I then tried to create a symlink
within the documents folder containing the original file to see what was
happening...

Let's call the document file ?myfile.odt?

cd ~/documents
ln -s myfile.odt mysymlnk

This created a symlink (mysymlnk) which successfully opened the document
myfile.odt

Next I tried to create a symlink on my Desktop...

ln -s myfile.odt ~/Desktop/

This created a padlocked symlink which did not open the document (hmmm...).
I repeated the command, except I created a hardlink on my Desktop...

ln myfile.odt ~/Desktop/

This created a link which DID open the document (that's better, but not a
symlink)

Finally I COPIED the functioning symlink from the documents folder...

cp mysymlnk ~/Desktop/

This created a Desktop symlink which DID open the document. HURRAH!

Finally I renamed the working symlink on my Desktop... the padlock
reappeared and the link no longer functioned.

I don't know if this is normal, but it was not intuitive.

What I learned... create the symlink within the same directory as the target
file, with the link named as you wish. Then copy it (I didn't try the move
command) to where you want it to reside.

The padlocked link was quite unexpected. This was all done on a common
partition, and within my user rights. I did notice that the properties of
the working link mentioned OpenOffice document; whereas the padlocked link
mentioned ?octet-stream? in its place.

Is this expected symlinking behavior?



More information about the QnA mailing list