How do you find the symbolic links to files.

DoN Nichols ceilidh!dnichols at uunet.uu.net
Thu Nov 29 15:39:17 AEST 1990


"Jon Brawn says:"
> 
   [...]
> I know how tar and cpio handle regular files and device nodes. I want to
> know about symbolic links.
> 
> I would hope that tar would copy the contents of the file. That would be
> do much more useful than trying to do a restore, and discovering that what
> you thought you had backed up as /usr/data_base/main_data_file was in
> actual fact just a sixty four character pathname to an obscure corner of the
> file system, and that you had, in fact, lost everything in the last crash...
> ...but I guess tar will probably just backup the symbolic path name anyway.

	From man tar on my Tektronix 6130 (running a 4.2BSD derivative
called UTek)

     h   Force tar to follow symbolic links as if they were
         normal files or directories. Normally, tar does not
         follow symbolic links.

(It normally just records that the entry is a Symbolic Link to a specific
file, whose name is shown.)  Gnu tar, on systems with symbolic links, can be
compiled with similar options, although I don't know at present whether the
same option selector is used.  My sources are all on backup media, since I
only have 67MB on this AT&T Unix-pc.  (Till the new drives arrive :-)


   [...]

> So, in summary:
> 
> I asked (quite nicely) how you played with symbolic links at a fairly
> nuts'n'bolts level, and got told to RTFM. Now, TFMs don't mention it
> because symbolc links are not in the ``currently popular'' releases.

	I think that some warning should be posted that frequently RTFM
actually is RMFM, where the first M is *MY*.  Everyone assumes that all
TFM's are identical.  Some systems don't even come with a machine-readable
FM, so grep-assisted scanning is not practical, and you are left with four
linear feet of manuals to juggle on your lap or desktop.  I have found cases
of options which are documented in others copies of TFM, but not in mine,
are still valid when tested.


   [..]

> So, whats the real truth about find, cpio & tar? how do they behave?

	From the same Tektronix 6130, the man page for cpio says:

     Cpio does not know about symbolic links, but since it is
     usually used with find, there is little danger of getting
     into loops. Also, instead of archiving or copying symbolic
     links, cpio copies the files pointed to by the links, if
     they exist.

     Only the superuser can copy special files.

Which all seems to be fairly resonable behavior.  (Of course this is on the
OS that started symbolic links, so you would hope that they would do it
right.

> -- 
> Jon?
> --
> jonb at specialix.co.uk
> 			"Never be sorry for a might have been."
> 


-- 
Donald Nichols (DoN.)		| Voice (Days):	(703) 664-1585
D&D Data			| Voice (Eves):	(703) 938-4564
Disclaimer: from here - None	| Email:     <dnichols at ceilidh.beartrack.com>
	--- Black Holes are where God is dividing by zero ---



More information about the Comp.unix.internals mailing list