In my own LFS-based OS, I had created many softlinks. Soft-link can be deleted without harming the target. But is there any way that If I remove the a file or directory then, I will be notified about it's soft link ? So that there will be no dangling soft-link pointer.Occasionally, finding dangling soft-link and then deleting is the way. But that will be static solution. I'm looking for dynamic way
Soft Link Detection
symlink
Unfortunately not. Soft link (aka symbolic link or symlink) destinations do not keep track of the fact they are linked to. Its not really possible, either: symlinks can cross filesystems, so the link could be on a different filesystem, which isn't even currently mounted.You could of course add a cron job to search for broken links nightly, and notify you. To find broken links, see How can I find broken symlinks (another question on this site).