-L Follow symbolic links. When find examines or prints information
about files, the information used shall be taken from the prop‐
erties of the file to which the link points, not from the link
itself (unless it is a broken symbolic link or find is unable to
examine the file to which the link points). Use of this option
implies -noleaf. If you later use the -P option, -noleaf will
still be in effect. If -L is in effect and find discovers a
symbolic link to a subdirectory during its search, the subdirec‐
tory pointed to by the symbolic link will be searched.
When the -L option is in effect, the -type predicate will always
match against the type of the file that a symbolic link points
to rather than the link itself (unless the symbolic link is bro‐
ken). Using -L causes the -lname and -ilname predicates always
to return false.
l symbolic link; this is never true if the -L option or the
-follow option is in effect, unless the symbolic link is
broken. If you want to search for symbolic links when -L
is in effect, use -xtype.
5 回答
这是我到目前为止发现的最好的东西 - 递归显示当前目录中的符号链接,但没有跟随它们,显示完整路径和其他信息:
输出看起来像这样:
这将以递归方式遍历
/path/to/folder
目录并仅列出符号链接:如果您的意图也是遵循符号链接,则应使用
find
命令,但应包含-L
选项;实际上find
手册页说:然后尝试这个:
这可能会有效:我在
find
手册页中找到了这个钻石:如果您使用的是-type
选项,则必须将其更改为-xtype
选项:然后:
一个命令,没有管道
干净利落...
扩展这个答案,这里有一些更符号链接
find
命令:查找指向特定目标的符号链接
请注意
link_target
是可能包含通配符的模式 .查找损坏的符号链接
-L
选项指示find
遵循符号链接,除非它被破坏 .查找并替换损坏的符号链接
更多查找示例
更多
find
示例可在此处找到:https://hamwaves.com/find/find
默认情况下已经递归查看:要查看符号链接本身,您可以使用
如果你想看到他们定位的文件,只需附加一个ls