Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-30-2006, 01:49 PM   #1
Registered: Jul 2005
Location: Lawrence, Kansas USA
Distribution: openSUSE 11.1
Posts: 44

Rep: Reputation: 15
Shell Script help or proper command


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

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!

Old 04-30-2006, 01:53 PM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,265

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Something like:

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.
Old 04-30-2006, 02:25 PM   #3
Registered: Jul 2005
Location: Lawrence, Kansas USA
Distribution: openSUSE 11.1
Posts: 44

Original Poster
Rep: Reputation: 15
That Did it. Thanks.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script for converting filenames to proper case? Yalla-One Programming 9 02-03-2010 03:37 AM
Executing a shell script command!! vishamr2000 Programming 4 08-15-2005 01:33 AM
command from shell script notworking Grassie Coetzee Linux - Software 1 03-14-2005 05:39 PM
Command in shell script Grassie Coetzee Linux - Software 1 03-13-2005 12:42 PM
Shell script login command? chup Linux - General 3 08-24-2003 07:43 PM

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

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