0

I've just read:

How to find all symbolic links pointing to any file/directory inside a given directory

but that is pretty slow. Now, on typical Linux systems, a filesystem database-of-sorts is maintained, which can be searched using locate, rather than iterating the entire filesystem.

Is it possible to utilize that database - as-is or with a tweak to the search procedure - to get symlinks pointing into a given directory? Or symlinks in general?

einpoklum
  • 9,515

1 Answers1

1

None of the updatedb implementations I've seen look at the target of symbolic links, or even store the file type. So no, the information isn't the database.

Storing symlink targets in a form that's efficient to search would be a significant change to the database format. You could reuse the directory traversal code from updatedb, but the part about the database format, and the locate-equivalent interface would be completely new work.