LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Remove Folders Recursively that contain *.mp3 files size 0KB or jpeg only. (https://www.linuxquestions.org/questions/linux-newbie-8/remove-folders-recursively-that-contain-%2A-mp3-files-size-0kb-or-jpeg-only-740138/)

Drigo 07-14-2009 11:16 PM

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!

w3bd3vil 07-15-2009 12:37 AM

the find command should be able to do that.

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

man find, should get you details.


All times are GMT -5. The time now is 11:31 PM.