I want to move a directory with a bunch of subdirectories and files. But I have the feeling there might be some symlinks to a few of them elsewhere on the file system. (As in the directory contains the targets of symlinks.)
How do I search all files for symlinks pointing to them?
Some combination of find, stat, ls, realpath, readlink and maybe xargs? I can’t quite figure it out.


because
zshI swapped out~->$HOME. In addition to some permission denied that you always getfinding over the home dir, I get these weird hits:lib atomic is something I’ve heard of vaguely but certainly not anything I use. I couldn’t identify any way this file was doing anything outside the
~/.konandir.the CSS files there were a few different ones in a couple different Firefox profiles. it’s the user customization. But I don’t think it should have anything to do with the directory I was asking for.
If I give it a bit more of a hint, telling to look in
~/.configspecifically, now I get some (but not all) the links I expect.And suggesting it searches in the
.konandir where it found lib atomimc, it now doesn’t find anything.Could be all kinds of things getting the way. Different versions of relevant tools, filesystems/setups, permissions…
You could pass
$1and$gotthrough$(realpath -P -- ...)to make sure all the path are in canonical form. Though now that I’m thinking about it,statis probably a better option anyway: