![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Copy unique files between two directories in Solaris | sujoy101 | Shell Programming and Scripting | 2 | 03-21-2008 11:59 PM |
| Copy single file to multiple directories | kthatch | UNIX for Dummies Questions & Answers | 2 | 11-11-2007 03:10 PM |
| get files from multiple directories using FTP | amit1209 | Shell Programming and Scripting | 2 | 09-26-2007 06:39 AM |
| How do copy certain files and directories from one hard drive to another? | shorty | UNIX for Dummies Questions & Answers | 4 | 02-11-2006 05:26 PM |
| FTP multiple files to different directories | abrd600 | Shell Programming and Scripting | 12 | 09-23-2004 04:56 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
copy multiple files in different directories
I have a report file that is generated every day by a scheduled process.
Each day the file is written to a directory named .../blah_blah/Y07/MM-DD-YY/reportmmddyy.tab I want to copy all of this reports to a separate directory without having to do it one by one. However, if I try cp .../blah_blah/Y07/*/report*.tab /new_directory/report*.tab I get "cannot create /new_directory/report*.tab: no such file or directory" however, ls .../blah_blah/Y07/*/report*.tab displays all the files I want to copy. How do I do this? Thanks. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
nevermind
duh, all i needed to do was:
cp .../blah_blah/Y07/*/report*.tab /new_directory/ |
|
#3
|
|||
|
|||
|
Copying files from multiple directories
If you are interested, this is a solution that I used to copy *.m4a files from multiple directories into a new directory:
find . -name "*.m4a" -exec cp "{}" /<dir> \; This will search for any occurrance of *.m4a in the current directory and any subdirectory and move them to the specified directory. |
|
#4
|
|||
|
|||
|
Use cp -r
I think cp -r <from> <to> can be used in this case.
Thanks Nagarajan Ganesan |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|