In Linux how do I find all soft links that link to a specific target directory or file?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You could use find
's -lname
argument:
find . -lname linktarget
回答2:
Use find
with -samefile
and -L
option, like this:
find -L -samefile TARGET
回答3:
What R1tschY sez, with an addition:
find -L -samefile TARGET \! -name TARGET
so TARGET
won't be included in the result. (The backslash is required in bash so the !
won't be interpreted as a history directive.)