|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | 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 Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
HOw to find and copy
Hi,
I need to find files in a directory, between dates like 4/15/06 and 5/02/06, and copy them to a different directory. Is there a way to doa find and a copy together? Thanks, Neil |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
You need to work out the -mtime +<days> and -mtime -<days> The +<days> = older than, -<days> = younger than Code:
find /path/to/files -mtime -30 -mtime +13 -print | \
while read file
do
cp "$file" /new/path/`basename "$file"`
doneYou may want to mess around with just the first line, until it prints the correct files for you. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Find and copy | lol100 | Shell Programming and Scripting | 1 | 10-12-2010 06:53 AM |
| Help with find and copy command | bbbngowc | Shell Programming and Scripting | 2 | 12-16-2009 03:37 PM |
| Help with Find All/Copy Script | jlfx | Shell Programming and Scripting | 2 | 08-31-2008 11:48 AM |
| need to help to find and copy to a file | pujars1 | UNIX for Dummies Questions & Answers | 2 | 07-12-2007 09:56 AM |
| Find directories not containing foo, and copy foo to them | dkaplowitz | Shell Programming and Scripting | 6 | 06-29-2005 08:50 AM |
|
|