RE: Locating the broken links

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Garrick Staples wrote:
> 
> On Mon, Jan 28, 2008 at 01:45:43AM +0200, Ioannis Vranos alleged:
> > Is there any command that I can use to find the broken 
> links that point 
> > to non-existent files?
> 
> Not pretty, but should work fine:
> 
> find . -type l 2>/dev/null| while read line;do  test -e 
> "$line" || echo "$line";done

Simpler way:

find . -L -type l -print

The -L tells find to follow symbolic links and use the file type
of the destination of the link instead of the link itself, so
it will only find files of type 'l' if it cannot find the file's
destination, a nice little side-effect.

-Ross

______________________________________________________________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux