views:

64

answers:

1

I need to process a number of directories, determine what files in them are symlinks, and what they link to. This sounds simple, but I have no control over the presence of control or other characters in the file names, and I need a robust solution.

So, given a file of arbitrary name, how do I safely determine what it links to, when the link destination can also have arbitrary contents?

+2  A: 

readlink -f <linkname>

eduffy
Thanks! That is exactly what I needed!
swestrup