Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-21-2007, 10:51 AM   #1
Registered: Mar 2007
Posts: 77

Rep: Reputation: 15
copy with find


I would like to copt files that find command finds somehow. None of this does not work

find less/DH* more/DH* -type f -name "all*.dat" -exec cp "c:\users\"

find less/DH* more/DH* -type f -name "all*.dat" | cpio -pdumv "c:\users\"

how to do properly this thing

Old 03-21-2007, 11:46 AM   #2
LQ Newbie
Registered: Mar 2007
Location: Italy
Distribution: Debian
Posts: 18

Rep: Reputation: 0
You are not passing enough arguments to cp. It requires both source and destination. Also, if you're using linux then "c:\users\" will not work. See man mount to map this folder into a linux directory (maybe your distribution already did this for you, run mount without parameters to check).

Assuming your c: drive is mounted under /dos, the correct command would be:

find less/DH* more/DH* -type f -name "all*.dat" -exec cp "{}" /dos/users/ ";"

(I assumed c:\users is the destination folder, is that right?) Make sure not to omit any needed quotes, and that less/DH* and more/DH* are directories. If it still does not work it would be helpful to copy the error message in your post.

Hint: using -iname instead of -name will ignore case. You might need it.

Last edited by nacio; 03-21-2007 at 11:49 AM.


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Where can I find "boot.img" to copy to my diskette? zahrul Linux - Newbie 9 01-02-2010 05:10 AM
CLI copy is greater than GUI copy ?? 0_o killahsmurf Slackware 14 01-04-2006 12:53 PM
find and copy files into multiple directories avargas22 Linux - Newbie 2 04-01-2004 12:11 PM
boot error after using Copy Commander to copy debian system onto larger new drive Interceptor Linux - Hardware 7 05-04-2003 01:40 PM
find files and copy them to zip drive william47304 Linux - Newbie 1 02-03-2002 04:52 PM > Forums > Non-*NIX Forums > Programming

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