Download your favorite Linux distribution at LQ ISO.
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 01-16-2005, 01:51 AM   #1
Registered: Sep 2001
Location: South Dakota
Distribution: RH, Xandros, SuSE, Debian
Posts: 41

Rep: Reputation: 15
locate and copy files - without directory tree

Seems like this should be easy, but...

I need to copy a whole lot of mp3 files from a directory tree into a single directory. Example of one existing directory tree:

David Bowie > Diamond Dogs > Rebel.mp3

Multiply that by 1400 or so. I want to copy all those *.mp3 files (into a new single directory) without any of the existing directories where they currently reside.

I've tried various combinations of command line arguments, but I must be missing something simple.

Thanks for any help...

Old 01-16-2005, 02:10 AM   #2
Senior Member
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
find /path/to/mp3/tree -name "*.mp3" -exec cp {} /path/to/flat/dir \;


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
copy 3 files to a directory and all subdirectories? snip128 Linux - Newbie 9 08-12-2005 09:18 PM
copy all of one filetype found by locate command to a single directory socratesone Linux - Software 3 06-22-2005 01:23 PM
copy files from directory to directory without subfile ALInux Linux - General 2 06-03-2005 11:51 AM
How to copy tree without files in it? BladeRunner Linux - Newbie 6 03-22-2004 01:01 PM
How to copy a directory tree without copying the files in it? system Linux - General 2 01-15-2002 09:36 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:47 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