[lug] Tools to navigate Unix links backwards?

Vince Dean vincedean at frii.com
Fri Jul 23 15:16:35 MDT 2010


On 7/23/2010 9:52 AM, Jeffrey Haemer wrote:

> Can you provide some use cases?   Examples of what
> you'd like to do if you had the tool of your dreams?

Good question. I was actually casting about for ways to understand or
visualize the structure, though I framed it as a specific question.

The problem is that links are easy to create, but hard to understand
after the fact. I understand that the file name is not actually a
property of the file, but of the directory entry which points to it, and
that the inode number is the unique identifier for the file.

I might have asked:

    Yikes -- I've got a thicket of hard and symbolic links and I'm
    having a hard time understanding the intent.  Any suggestions?

For example, consider the case where someone made a new version
of a directory tree by creating symbolic links in place of files:

   cp -rs /foo/v1 /foo/v2

and then broke the links for those files in v2 which need to
be different from v1, replacing the links with actual
files.  This may be a be convenient when creating the new version but is
a maintenance trap for someone else who modifies a file in v2 without
realizing that he is simultaneously modifying the file in v1.

Use cases might be:

    I am finding what appears to be the same file in several different
    places. When I look at the inode numbers, I see that they are
    in fact the same file.  How many other links point to the same file?
    Which other files have multiple paths?  What is the intent?

    I am seeing lots of links in this part of the system.
    Maybe some sort of listing will help me see the pattern.

I'll probably be poking around with whatever tools I have, writing
scripts that run find and ls -il, and drawing lots of pictures, until I
get a better idea what the structure is.  We do have people who are
familiar with the system, so I am not starting from scratch.

Vince




More information about the LUG mailing list