Codingfind -not -name [multiple search strings]

 

Press Ctrl+Enter to quickly submit your post
Quick Reply  
 
 
  
 From:  CHYRON (DSMITHHFX)  
 To:  ALL
41731.1 
to find number of files in a directory of mac files without the mac cruft counted in, I tried:
Code: 
find . -not \( -name ".?*" -prune \) -type f | wc -l
However the number returned is suspiciously high. So I'm thinking it may be counting files inside ".*" folders. On examining in a gui file browser (emelFM2) with hidden files displayed, I saw a number of files which do not fit the dot prefix pattern (see attached), so now I want to sweep them all up in one go, but struggling with the syntax:
Code: 
find . -not \( -name ".?*, _?*, db_?*, lock, log?*, cnid?*" -prune \) -type f | wc -l
find . -not \( -name ".?*", "_?*", "db_?*", "lock", "log?*", "cnid?*" -prune \) -type f | wc -l
both fail, the first returning all files (so not filtering out any), the second returning a "paths must precede expression" error.

Anyone know how this should be put?
Roland Skollani was sick of Pittsburgh. This city was the dead-end of his failed dreams and even dope didn’t help his choking fits no more. It had been a mistake to leave Hollywood and to follow Rita. Maybe it was a twist of fate, that there were only a few days left to leave his ex-wife’s house. Now he MUST act. Rita had a new lover and he didn’t mind, but why of all people did she choose this greedy, corrupt cop Lennon?

Attachments:

0/0
 Reply   Quote More 

 From:  CHYRON (DSMITHHFX)  
 To:  ALL
41731.2 
Code: 
find . -name ".AppleDouble" -type d -print0|xargs -0 rm -r --
Did the trick.
Roland Skollani was sick of Pittsburgh. This city was the dead-end of his failed dreams and even dope didn’t help his choking fits no more. It had been a mistake to leave Hollywood and to follow Rita. Maybe it was a twist of fate, that there were only a few days left to leave his ex-wife’s house. Now he MUST act. Rita had a new lover and he didn’t mind, but why of all people did she choose this greedy, corrupt cop Lennon?
0/0
 Reply   Quote More 

Reply to All    
 

1–2

Rate my interest:

Adjust text size : Smaller 10 Larger

Beehive Forum 1.5.2 |  FAQ |  Docs |  Support |  Donate! ©2002 - 2024 Project Beehive Forum

Forum Stats