LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 01-16-2005, 02:51 AM   #1
rodda
Member
 
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...

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

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


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


All times are GMT -5. The time now is 09:00 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration