Linux symbolic links

(imported topic written by davidwong91)

We’re looking to write relevance that will determine whether a linux/unix folder (say, “/usr/tmp”) is a symbolic link, and if it is, we want to identify what it points to. Is there a way to do this using any Linux inspectors?

Thanks in advance for any help you can offer.

(imported comment written by jessewk)

David,

There currently is no good inspector to determine if a file is a symbolic link, and if so where it points.

One possible work around, depending on your needs, is to verify if the folder path actually resides on the same file system. For example, on my HP-UX machine /usr/tmp is actually located at /var/tmp. If the name of the file system is not “/usr” than you know either var or tmp is a symbolic link. e.g:

Q: name of filesystem of folder “/usr/tmp”

A: var

Another work around would be to create a fixlet that runs a utility to check if the folder is actually a link and send the results to a file. You could then use relevance to extract the contents of the file.

Hopefully that will work well enough for you. For the future, I’ve filed a request for a proper symbolic link inspector.

-Jesse

(imported comment written by boerio)

Yeah, this doesn’t work so well if things point to /dev/null, though. Or if a file is a symlink to something else on the same filesystem.

Any ideas on when this will be supported?

Thanks.