The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 08-12-2008
moncul moncul is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 1
How about a situation where you only want to find all regular files, but omit certain directories? Eg, i tried:

find . -name 'dir1' -prune -o name 'dir2' -prune -o type f

And the above does give me just regular files, except i get an entry for 'dir1' and 'dir2'; even though none of the files underneath these directories appear in the final list (which is what i want). I also want to omit the 'dir1' and the 'dir2' entries. They're the only things that show up in my output that are not regular files.

Thanks.