Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!boingo.med.jhu.edu!haven!decuac!hussar.dco.dec.com!mjr From: mjr@hussar.dco.dec.com (Marcus J. Ranum) Newsgroups: comp.unix.internals Subject: Re: How do you find the symbolic links to files. Message-ID: <1990Nov27.191633.28103@decuac.dec.com> Date: 27 Nov 90 19:16:33 GMT References: <1990Nov26.150716.7268@specialix.co.uk> <1990Nov26.193324.5396@decuac.dec.com> <1990Nov27.155015.24837@specialix.co.uk> Sender: news@decuac.dec.com (Network News) Organization: Digital Equipment Corp., Washington Ultrix Resource Center Lines: 47 jonb@specialix.co.uk (Jon Brawn) writes: >>>Does 'find' have a wonderful flag for finding symlinks? >> read the manual page on find(1). >Hmm. And? SCO Unix doesn't appear to document it - hang on a mo I'll >look at Interactive... >...nope. So, having RTFM, I find nothing useful. The question remains >unanswered. Use "find dir -type l -print" to print the name of symlinks. Sorry I reflexively RTFM'd you - it's surprising that a vendor would sell a UNIX with symlinks and *NOT* have readlink(2), lstat(2), the -l option to find, etc, etc, etc [or some similar and documented features]. In fact, I would not purchase such a UNIX, if I knew of one. Since your version(s?) of UNIX (SCO/interactive?) appear to be missing stuff, according to you, all bets are off - so I'll tell you how ULTRIX/BSD handle these things. >I know how tar and cpio handle regular files and device nodes. I want to >know about symbolic links. tar with the -h makes a copy of the contents of the symbolic link, otherwise it defaults to just storing information about the link so it can recreate the link. >[...] When something new comes along, I >like to be able to ask those more priviledged than myself for >enlightenment, so they can look in their manuals and say, 'Theres >this new O/S call [...] That's why I think Barry and I RTFM'd you - it's *NOT* new stuff, it's been around for several years, and that's forever at the rate new stuff gets kluged into UNIX these days. :) Plus, your original postings somehow led me to think you had symlinks on your machine(s?) - I'm surprised anyone would buy a UNIX that had symlinks but no decent ways to examine them, etc. If you do an "ls -l" (or -L?) does "ls" display the links ? If so, your machine probably does have lstat(2) - try to write a program that calls it (just like stat) and if it's not in TFM, then complain to the vendor. mjr. -- Good software will grow smaller and faster as time goes by and the code is improved and features that proved to be less useful are weeded out. [from the programming notebooks of a heretic, 1990]