LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 03-21-2007, 09:51 AM   #1
ovince
Member
 
Registered: Mar 2007
Posts: 77

Rep: Reputation: 15
copy with find


hi

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

thanks
oliver
 
Old 03-21-2007, 10:46 AM   #2
nacio
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 10:49 AM.
 
  


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 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 04:10 AM
CLI copy is greater than GUI copy ?? 0_o killahsmurf Slackware 14 01-04-2006 11:53 AM
find and copy files into multiple directories avargas22 Linux - Newbie 2 04-01-2004 11:11 AM
boot error after using Copy Commander to copy debian system onto larger new drive Interceptor Linux - Hardware 7 05-04-2003 12:40 PM
find files and copy them to zip drive william47304 Linux - Newbie 1 02-03-2002 03:52 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:21 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration