LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-15-2009, 12:16 AM   #1
Drigo
Member
 
Registered: Jun 2009
Posts: 111

Rep: Reputation: 17
Remove Folders Recursively that contain *.mp3 files size 0KB or jpeg only.


Hello,
Something happened with all my music and now I have zero bytes folders or empty folders with only jpeg. Is there a command that:

1) Find recursively folders (folders inside a folder) with *.mp3 0KB
2) Find folders inside folders with only jpgs
3) Remove those folders until it get to a parent directory.

I will greatly appreciate it.

Thanks!
 
Old 07-15-2009, 01:37 AM   #2
w3bd3vil
Senior Member
 
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,189

Rep: Reputation: 49
the find command should be able to do that.

find /mymp3s -name "*.mp3" -size 0c -exec rm -rf {} \;

man find, should get you details.
 
  


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
find -exec command to recursively delete files and folders in folders with X name Joan Murt Linux - Newbie 2 07-08-2009 05:35 PM
Entering folders recursively to run script on files nested inside, ubuntu 7.10 aidansmoker Linux - Newbie 4 11-12-2007 12:39 AM
remove ~ from all files and folders BoraX Linux - General 1 10-25-2006 08:58 PM
How to unzip files recursively inside folders? jessdog9001 Linux - Software 2 03-22-2006 01:59 PM
Remove files w/ extension txt recursively spiri Linux - General 4 12-14-2005 04:52 AM


All times are GMT -5. The time now is 06:23 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration