红联Linux门户
Linux帮助

linux下查找无效的符号连接

发布时间:2006-10-06 13:44:33来源:红联作者:williamEXE
命令:
find -L /path/to/dir -type lfind /path/to/dir -follow -type l


[code] -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.[/code]


[code] -follow
Deprecated; use the -L option instead. Dereference symbolic
links. Implies -noleaf. The -follow option affects only those
tests which appear after it on the command line. Unless the -H
or -L option has been specified, the position of the -follow
option changes the behaviour of the -newer predicate; any files
listed as the argument of -newer will be dereferenced if they
are symbolic links. The same consideration applies to -anewer
and -cnewer. Similarly, the -type predicate will always match
against the type of the file that a symbolic link points to
rather than the link itself. Using -follow causes the -lname
and -ilname predicates always to return false.[/code]
文章评论

共有 2 条评论

  1. chameleon 于 2006-10-06 21:15:38发表:

    不错,比较实用

  2. Redassociation 于 2006-10-06 19:11:00发表:

    不太懂,顶一下