Does anyone know of some tool capable of keeping symbolic links valid in spite of renaming or moving of files or directories? If not, are there obvious reasons why this should be difficult to implement? I'm thinking of a daemon that could a) keep track of creation and deletion of symbolic links, maintaining a database of existing links; and b) keep track of renaming and moving of file system objects, to be able to search the database for affected links and automatically fix them. Cheers.
This line of
find command lists you all symbolic links that point to no file.
# Ask `find` to walk files in some/dir in this manner: # -L Follow symlinks. Use symlink it self if its can't be followed # -type l Only care about symlinks. So we only get failed symlinks from -L. # -ls list current file in `ls -dils` format. find -L some/dir -type l -ls
You may use this to find broken links, or links to files that "you" cannot read because of missing permissions. So run this command by a user with sufficient privilleges.