[PLUG] Tracing back symlinks
Paul Heinlein
heinlein at attbi.com
Wed May 29 19:55:00 UTC 2002
On Wed, 29 May 2002, Sean Lewis wrote:
> On Wed, 2002-05-29 at 12:25, Ed Sawicki wrote:
> > Given a normal file that has symbolic links pointing to it, is
> > there a way to list all the links (the aliases pointing to the
> > normal file)?
>
> The only thing I can think of would be to use find, searching for
> the text string of the file location in file contents.
You can do something like
find / -type l -printf '%p -> %l\n'
to get a listing of symlinks and the files to which they point.
Besides what Wil mentioned about links possibly residing on systems
that mount the file in question via nfs, there's also the problem of
relative links (e.g., foo -> ../../../foo). So if foo isn't uniquely
named, you'll have to manually look through the find results to catch
all potential links.
--Paul Heinlein <heinlein at attbi.com>
More information about the PLUG
mailing list