LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-02-2005, 04:34 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
how to search for and delete empty directories?


I've got 2400 directories... some of which contain images, some do not (but contain other stuff).

I want to be able to sift through the ones that don't contain images (either .jpg, .gif, or .bmp) and remove the entire dir.

having trouble making a script that will do that.

suggestions?
 
Old 06-02-2005, 04:45 PM   #2
juanbobo
Member
 
Registered: Mar 2005
Location: Chicago
Distribution: Gentoo AMD64
Posts: 365

Rep: Reputation: 30
du --exclude?

Last edited by juanbobo; 06-02-2005 at 04:48 PM.
 
Old 06-02-2005, 04:49 PM   #3
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
... edited, nevermind.

still don't have a solution...

Last edited by BrianK; 06-02-2005 at 04:51 PM.
 
Old 06-02-2005, 05:06 PM   #4
juanbobo
Member
 
Registered: Mar 2005
Location: Chicago
Distribution: Gentoo AMD64
Posts: 365

Rep: Reputation: 30
Sorry, can't think of anything right now...

Last edited by juanbobo; 06-02-2005 at 05:13 PM.
 
Old 06-03-2005, 07:24 AM   #5
Ynot Irucrem
Member
 
Registered: Apr 2005
Location: Perth, Western Australia
Distribution: Debian
Posts: 233

Rep: Reputation: 30
are all 2400 directories in the same directory? if so, is there anything else in that directory?
do the 2400 directories all follow some sort of naming convention (e.g. folders are named folder1, folder2, folder3)?
are there any sub-folders in any of the 2400 folders? if so, are there any .jpgs, .gifs, or .bmps in those sub-folders?

Last edited by Ynot Irucrem; 06-03-2005 at 07:55 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete non-empty directories? Also have a terminal question Nylex Linux - General 10 07-15-2005 11:51 PM
Removing non-empty directories brunnopessoa Linux - Newbie 8 11-13-2003 07:56 PM
how do I remove all empty directories? noisybastard Linux - General 2 08-10-2003 11:47 PM
Delete Empty files whospeaks2me Linux - Newbie 2 07-18-2003 10:39 PM
finding empty directories... PokerFace Linux - General 2 10-16-2002 08:23 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration