[CentOS] strange 'find' tool behavior

Gelen James hahaha_30k at yahoo.com
Tue Nov 20 00:44:31 UTC 2012


Hi all,

Just encountered an strange bahavior of frequent 'find' command. I tried to use find to recursively remove .svn directories from my working place, 'find' command removed all the '.svn' directories successfully but reported errors on screen. Any one knows why it shows this behavior?

BTW, if I use command " find . type d -name '.svn' -print0 | xargs -0 -n1 /bin/rm -rf ", then it does the same job and reports no errors on screen at all. But still likes to understand why find have this behavior.

The screen and error prompts are attached below for your references. Thanks.

[root at centos_58_test_box workingDir]# find . -type d -name '.svn'                                                                                                                                 
./.svn                                                                                                                                                                                            
./var/.svn                                                                                                                                                                                        
./var/myTestProj/projects/.svn                                                                                                                                                                    
./var/myTestProj/projects/Production/.svn                                                                                                                                                         
./var/myTestProj/projects/Production/etc/.svn                                                                                                                                                     
./var/myTestProj/projects/Production/jobs/.svn                                                                                                                                                    
./var/myTestProj/.svn                                                                                                                                                                             
./etc/.svn                                                                                                                                                                                        
./etc/myTestProj/.svn                                                                                                                                                                             
./etc/myTestProj/ssl/.svn                                                                                                                                                                         
[root at centos_58_test_box workingDir]# find . -type d -name '.svn'  -exec  /bin/rm -rf '{}' \;                                                                                                     
find: ./.svn: No such file or directory                                                                                                                                                           
find: ./var/.svn: No such file or directory                                                                                                                                                       
find: ./var/myTestProj/projects/.svn: No such file or directory                                                                                                                                   
find: ./var/myTestProj/projects/Production/.svn: No such file or directory                                                                                                                        
find: ./var/myTestProj/projects/Production/etc/.svn: No such file or directory                                                                                                                    
find: ./var/myTestProj/projects/Production/jobs/.svn: No such file or directory                                                                                                                   
find: ./var/myTestProj/.svn: No such file or directory                                                                                                                                            
find: ./etc/.svn: No such file or directory                                                                                                                                                       
find: ./etc/myTestProj/.svn: No such file or directory                                                                                                                                            
find: ./etc/myTestProj/ssl/.svn: No such file or directory                                                                                                                                        
[root at centos_58_test_box workingDir]# find . -type d -name '.svn'                                                                                                                                 
[root at centos_58_test_box workingDir]# 

Thanks.


More information about the CentOS mailing list