Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
Bash how to delete all files of multiple extensions excluding one directory

I have this snippet

find . \( -iname \*.ini -o -iname \*.properties -o -iname \*.xml \) -type f -delete

which deletes everything in all subfolders that contains those extensions, which is exactly what I want.

The only change I want to make is now I would like to have this exclude a directory called "Resources/". I want it to delete all noted extension files in all subfolders EXCEPT for Resources directory.

I am not sure how to do this however.

Any and all help is appreciated

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

The below command should exclude the resources dir,

find . \( -iname \*.ini -o -iname \*.properties -o -iname \*.xml \) -type f -not -path "./resources/*" -delete
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!