How do you find the symbolic links to files.

Andy Crump andyc at bucky.intel.com
Thu Nov 29 22:06:17 AEST 1990


>>>>> On 27 Nov 90 20:57:42 GMT, ddean at rain.andrew.cmu.edu (Drew Dean) said:


Drew> There seems to be a simple problem here.  Symbolic links come from an old BSD
Drew> release (sorry, I forget my Un*x history, was it 4.2 or 4.1 or earlier; it's
Drew> not in _The Design and Implementation of the 4.3BSD UNIX Operating System_),
Drew> and the poster is trying to use them on System V.  Now, it looks like Sys V is
Drew> broken (what's new :-)), at least with respect to things like man pages.  Since
Drew> a great deal of Usenet (especially the portion on the Internet) runs a
Drew> BSD-derived Unix, the proper answer for BSD is RTFM, because it's all there.


In SVR4, tar has the option L for following symlinks, and by default
does not follow.  Quote from the SVR4 manpage for tar.

               L       Follow symbolic links.  This causes symbolic links
                       to be followed.  By default, symbolic links are not
                       followed.

Cpio also has the same option in SVR4:

               -L   Follow symbolic links. The default is not to follow
                    symbolic links.

And find has -type l for symlink types and -follow to determine
whether to follow symlinks or not:


               -type c         True if the type of the file is c, where c
                               is b, c, d, l, p, or f for block special
                               file, character special file, directory,
                               symbolic link, fifo (named pipe), or plain
                               file, respectively.

               -follow         Always true; causes symbolic links to be
                               followed.  When following symbolic links,
                               find keeps track of the directories visited
                               so that it can detect infinite loops; for
                               example, such a loop would occur if a
                               symbolic link pointed to an ancestor.  This
                               expression should not be used with the -type
                               l expression.

   --- FYI ---
--

    -- Andy Crump

    ...!tektronix!reed!littlei!andyc | andyc at littlei.intel.com
    ...!uunet!littlei!andyc          | andyc at littlei.uu.net

Disclaimer: Any opinions expressed here are my own and 
            not representive of Intel Corportation.



More information about the Comp.unix.internals mailing list