[LBo] Symlink peculiarities
Ron Blanchett
muteid10t at gmail.com
Sun Jan 7 21:57:27 CET 2007
A symlink is created via ln -s 'Target' 'LinkName'
'Target' should be the full path to the file being linked to.
'LinkName' should be the full path including the NAME of the symlink you
would like to create.
In your case to create the link on your 'Desktop' you should have used the
following command.
ln -s ~/documents/myfile.odt ~/Desktop/myfile.odt
The problem that you where having is that you where not specifying the name
of the link file to create. The reason it worked when you created the link
in the same directory was due to the fact that you did specify a name of
the link file.
-Ron
On 1/7/07, Anerobe <anerobe at yahoo.com> wrote:
> 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?
>
> --
> QnA mailing list - To post: QnA at linuxbasics.org
> Site: http://LinuxBasics.org
> List-options: http://LinuxBasics.org/cgi-bin/mailman/listinfo/qna
>
More information about the QnA
mailing list