Linux: Trouvez tous les liens symboliques d'un "original" fichier? (reverse 'readlink')

Considérer la ligne de commande suivante extrait de:

$ cd /tmp/
$ mkdir dirA
$ mkdir dirB
$ echo "the contents of the 'original' file" > orig.file
$ ls -la orig.file 
-rw-r--r-- 1 $USER $USER 36 2010-12-26 00:57 orig.file

# create symlinks in dirA and dirB that point to /tmp/orig.file:

$ ln -s $(pwd)/orig.file $(pwd)/dirA/
$ ln -s $(pwd)/orig.file $(pwd)/dirB/lorig.file
$ ls -la dirA/ dirB/
dirA/:
total 44
drwxr-xr-x  2 $USER $USER  4096 2010-12-26 00:57 .
drwxrwxrwt 20 root          root          36864 2010-12-26 00:57 ..
lrwxrwxrwx  1 $USER $USER    14 2010-12-26 00:57 orig.file -> /tmp/orig.file

dirB/:
total 44
drwxr-xr-x  2 $USER $USER  4096 2010-12-26 00:58 .
drwxrwxrwt 20 root          root          36864 2010-12-26 00:57 ..
lrwxrwxrwx  1 $USER $USER    14 2010-12-26 00:58 lorig.file -> /tmp/orig.file

À ce point, je peux utiliser readlink pour voir qu'est-ce que l '"original" (eh bien, je suppose que l'habitude terme ici est soit "cible" ou "source", mais ceux dans mon esprit, peuvent être à l'opposé des concepts, donc je vais juste l'appeler "original") fichier des liens symboliques, c'est à dire

$ readlink -f dirA/orig.file 
/tmp/orig.file
$ readlink -f dirB/lorig.file 
/tmp/orig.file

... Cependant, ce que je voudrais savoir est - il une commande que je puisse courir sur le fichier, et de trouver tous les liens symboliques qui pointent vers elle? En d'autres termes, quelque chose comme (pseudo):

$ getsymlinks /tmp/orig.file
/tmp/dirA/orig.file 
/tmp/dirB/lorig.file

Merci d'avance pour vos commentaires,

Cheers!

InformationsquelleAutor sdaau | 2010-12-26