I frequently move directory trees to other locations or copy their tarballs to other machines, and I would like to have a method to check whether any symlinks in a directory tree A point to locations outside of A since these will be broken in the moved / copied directory.
|
You want a program called E.g.:
|
|||
|
|
|
Use bindfs to create another view of that directory tree.
Then use the symlinks utility (shipped by many distributions, or compile it from source) to detect cross-filesystem links.
(Note that parsing the output assumes that your symbolic links and their targets do not contain newlines, nor do paths to symbolic links contain the substring |
|||
|
|
|
With zsh:
Now, if the directory is But even then, a |
||||
|
|
|
GNU coreutils provedes
|
|||
|
