[nSLUG] Command line fu

Rich budman85 at eastlink.ca
Sat Sep 12 16:55:25 ADT 2009



Daniel Morrison wrote:
> 2009/9/12 Rich <budman85 at eastlink.ca>:
>   
>> Find broken symlinks  (not sure which version they added xtype, may not work on all systems)
>>    find . -xtype l
>>     
>
> -xtype has been in GNU findutils at least since the initial revision
> was entered into their source code repository in 1996 (version 4.1).
>
>   
Thanks, should of said other non-GNU versions. 

> But you might be on a Mac which lacks -xtype, so:
>
> My reading of the man page suggests that -xtype may be a convenience option for:
>
> find -L . -type l
>
> ...which is virtually the same as:
>
> find . -follow -type l
>
> Follow symbolic links, and check the type of the target. The target
> can never be a link[*], so the type check always fails, _unless_ the
> link could not be followed (i.e. is broken).
>
> However I do find the man page to be quite complex and confusing, so I
> may not have it completely correct. Seems to work for me.
>   
Thanks, I think I used the second suggestion before I found out how to 
use the xtype option.
I agree the documentation for that option needs clarification.





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/mailman/private/nslug/attachments/20090912/66e90efe/attachment.html>


More information about the nSLUG mailing list