LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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
 
LinkBack Search this Thread
Old 01-16-2005, 01: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, 02:10 AM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
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
Trackbacks are Off
Pingbacks are On
Refbacks are 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


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

Main Menu
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