[mdlug] Painfully simple ln -s command question

Raymond McLaughlin driveray at ameritech.net
Thu Jan 28 00:53:35 EST 2010


MDLUGers:
I have been chasing this around for over an hour, the man page is no
help,  and it's bugging me.

I have a directory off my home:
   ~/bin .
This directory contains an executable:
   ~/bin/clearline .
I want to create a simlink in this directory that looks like this:
   bin/cln -> clearline

The simplest way to just do it is:
    $ cd bin
    $ ln -s clearline cln

But I should be able to do this with one command, from within my home
directory.

But this is what happens: the command
    $ ln -s bin/clearline  cln
results in a simlink to the right file, but in the current (home) directory.

The commands:
     $ln -s bin/clearline ~/bin/cln
and
     $ln -s bin/clearline ./bin/cln
results in malformed simlinks *in the ~/bin directory:
 bin/cln -> bin/clearline
that point to a file in a nonexistent subdirectory: ~/bin/bin .

The command:
    $ ln -s ~/bin/clearline  ~/bin/cln
does create a link to the right file, in the right directory, but it
takes the form:
    cln -> /home/rmclaughlin/bin/clearline
rather than the desired
    cln -> clearline .

I could have worked around this with a cd command and then the link
command, but it just bugs me that I can't come up with a working single
command sytax.

It's probably obvious, but I don't see it. Any help?

Raymond McLaughlin







More information about the mdlug mailing list