[mdlug] Painfully simple ln -s command question

Robert Citek robert.citek at gmail.com
Thu Jan 28 02:14:16 EST 2010


On Thu, Jan 28, 2010 at 1:42 AM, Raymond McLaughlin
<driveray at ameritech.net> wrote:
> My error seems to have been inclusion of
> the 'bin/' directory specification in the "TARGET". This is counter
> intuitive to me. 'ln' looks at the LINK_NAME to determine where to find
> the TARGET. Guess I'll have to retool my intuition.

Maybe.  For example,

$ ln -s ~/bin/foo ~/bin/bar

I read this in four steps backwards (from right to left).  That is, ln will ...
1) create link called bar ...
2) in the ~/bin/ folder ...
3) pointing to a file foo ...
4) in the ~/bin/ folder

Another example,

$ ln -s ../bin/foo ~/bin/bar

ln will ...
1) create link called bar ...
2) in the ~/bin/ folder ...
3) pointing to a file foo ...
4) in the ../bin/ folder

Relative paths (./ or ../) in the TARGET are relative to the location
of the LINK_NAME.

Regards,
- Robert



More information about the mdlug mailing list