orphan soft linked files

How can we find files that were soft linked to an original file and then the original has been deleted. these soft linked files won't then be accessible. How can we find orphan linked files?

Thanks,

Having made a symbolic link to a non-existant file:

$ ls -l /tmp/fred /fred
ls: cannot access /fred: No such file or directory
lrwxrwxrwx 1 tony tony 5 2009-08-07 23:03 /tmp/fred -> /fred
$ 

Try to list the file the link points to:

$ ls -lL /tmp/fred
ls: cannot access /tmp/fred: No such file or directory
$ echo $?
2
$ 

Combine that with a:

find -type l

To find all the symbolic links and you have a method of locating broken symbolic links.

It looks like you are working with known file with known broken links. I am trying to list all the soft links that are broken or orphaned. I don't know them as of yet.

Thanks,

No I am not assuming file names, by using the find(1) command you will find all links in and below the directory you are in.