![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| list the files but exclude the files in subdirectories | shyjuezy | UNIX for Dummies Questions & Answers | 8 | 10-15-2008 10:42 AM |
| Listing subdirectories and files | senthil_is | Shell Programming and Scripting | 1 | 05-24-2008 04:38 AM |
| Listing all files in all subdirectories | kuciauskas | UNIX for Dummies Questions & Answers | 3 | 02-01-2008 02:45 PM |
| tar subdirectories for specific files | ronald_brayan | UNIX for Advanced & Expert Users | 4 | 10-12-2006 02:53 AM |
| Searching files within subdirectories | jalvarez | UNIX for Dummies Questions & Answers | 1 | 09-08-2003 01:12 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
copy certain files from subdirectories
Hi all,
I'd very grateful for some help with the following. I have a variable number of subdirectories each of which contain a uniquely names results file of the form Results*.dat. I would like to search through all subdirectories and copy out these results file to another directory so that I can combine them, diff them etc. find . -name Results*.dat will find all the files for me. How should I pass this to cp (copy)? Thanks, E |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
find . -name Results*.dat -exec cp {} /destination/dir \;
vino |
|
#3
|
|||
|
|||
|
Thanks very much
|
|
#4
|
|||
|
|||
|
find dir/ -name 'Results*.dat' | xargs cp -a --target-directory=/dest/dir --parents
|
|||
| Google The UNIX and Linux Forums |