How can I find out which file(s) links to another file

Solution 1:

Symbolic links are just an entry in the currenct directory, as any other file. So if you want to find all symbolic links, you need to run find / -type l -ls or similar.

The link target (../Cellar/gettext/0.21/bin/envsubst) has no way of knowing which symbolic links points to it so there is no easy way to go "backwards".

You could run find / -type l -ls > /tmp/symlinks and then analyze the result to find link targets.

PS: StackOverflow has more on this: Find all symlinks of a given 'original' file? (reverse 'readlink')