link (ln) with *one* name?

Glenn R. Stone gs26 at prism.gatech.EDU
Mon Aug 13 02:25:33 AEST 1990


In <5698 at uwm.edu> jgd at csd4.csd.uwm.edu (John G Dobnick) writes:

>Stupid question time (I haven't asked one of these for a while, so
>I'm due.  :-) ]

It ain't a stupid question if you don't know the answer.
     -- old User Assistants' motto.
     (they don't use it any more; they've gone way downhill :( )

>Re: 4.3 "ln".  The manpage says ln(1) can be called with only one name.
>	       What purpose does this serve?   Given that ln(1) is
>	       supposed to create "links", I would think you need a
>	       minimum of *two* filenames, no?  What am I missing
>	       here?

If I do

plab:/usr/rbin> ln -s /bin/diff

I've created a symlink in the current directory to /bin/diff, with the 
name "diff".  (real useful for your rsh freshcritters to be able to check
their programs against published answers :)  In general, ln(1) with a 
single argument makes a link to the specified file with a name the same
as the last element of the given file path, the new link being in the current
working directory.

So, after the above example,

plab:usr/rbin> ls -l diff

lrwx------  1 gs26            9 Aug 12 12:14 diff -> /bin/diff

Methinks TFM could benefit from an example.  Of course, then we 
UN*X gurus couldn't benefit from job security.... :) :) :)

p.s. no, vernard, that's not YOUR plab I was playing on... :)

-- Glenn R. Stone
gs26 at prism.gatech.edu



More information about the Comp.unix.questions mailing list