[net.unix] Symbolic links question

martin@noscvax.UUCP (06/13/84)

    Given the command 'ln -s foo foo.sl', which creates a symbolic link
to an arbitrary file foo,
Is there any documentation on which commands operate on foo, and which
operate on foo.sl?
Commands such as ls, mv, and rm operate on foo.sl, whereas commands
like cat, cp, and grep, given foo.sl as an argument, operate on foo.
That is, 'mv foo.sl foo2' results in foo2 having the type 'symbolic link',
whereas 'cp foo.sl foo2' makes foo2 a duplicate of foo.
How can I determine, other than trial-and-error which commands use foo.sl and which
use foo?
Doug Martin
martin@nosc

dan@haddock.UUCP (06/27/84)

#R:noscvax:-52100:haddock:16700022:000:578
haddock!dan    Jun 26 01:42:00 1984

The general rule is that symbolic links are just like additional hard links.
If foo.sl were an additional hard link to a file that already existed under
another name, then 'mv foo.sl foo2' would rename the additional hard link
without otherwise affecting the file, while 'cp foo.sl foo2' would copy
the contents of the file, and 'rm foo.sl' would remove the additional
hard link and leave the file in place under its original name.

The exception to this rule is 'ls', because it's useful for ls's report
to tell you whether you've got a symbolic link in this directory or not.

smk@axiom.UUCP (Steven M. Kramer) (06/28/84)

The noticeable difference between symbolic and hard links is that
you (as a user) can link directories with symbolic links.  Then,
doing pwd shows the REAL directory pathname and cd .. moves you
up the real tree.  I like to think of a symbolic link as a
cliff or divingboard where it plops you into a pit (another
directory) and you can't get out the same way but must climb up the
long grade (a cd ..).
-- 
	--steve kramer
	{allegra,genrad,ihnp4,utzoo,philabs,uw-beaver}!linus!axiom!smk	(UUCP)
	linus!axiom!smk@mitre-bedford					(MIL)