LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Shell Script help or proper command (https://www.linuxquestions.org/questions/linux-general-1/shell-script-help-or-proper-command-440308/)

jmikeneedham 04-30-2006 12:49 PM

Shell Script help or proper command
 
Hello:

I am running Debian 3.1R2 (Sarge) and just ported over some data from Windows and subsequently MacOS 10.4.

There are in many directories in my music folder artifacts presumably made by iTunes on MacOS 10.4 that cause Amorak to have issues. I have temporarily deleted the offending files from the playlist, but they exist on the filesystem and I would like to delete them all. This is a daunting task because there are several sub-directories to get to the actual MP3 files, so over a thousand in a sea of 100 directories.

The files are <dot> files with the following structure: ._nameoffile.mp3

I am a complete newbie to shell scripting and so far can't even make the RM command remove them in the whole structure. The directory structure (in case it is important) is as follows:

My Music
|
|
ArtistName
|
|
AlbumName
|
|
Mp3file

That is the major task is to delete the files ._*.mp3 from the entire structure (abridged).

The other artifacts are from Windows in My Pictures, the same type of problem but the files are the thumbs.db that Windows inserts.

I need to know the command to do this or complete help writing a shell script to do this, though I only need to do this once, so perhaps the proper command would be sufficient.

Thanks in advance for your help!

Mike

btmiller 04-30-2006 12:53 PM

Something like:

Code:

find . -name "._*.mp3" -exec rm -i {} \;
from the "My Music" directory should do it. I added the -i to rm to make it prompt before removing anything.

jmikeneedham 04-30-2006 01:25 PM

That Did it. Thanks.


All times are GMT -5. The time now is 07:21 PM.