![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| shell script to find and copy the files creted in the year 2006 to another directory | manas6 | Shell Programming and Scripting | 2 | 04-01-2008 04:04 AM |
| need to help to find and copy to a file | pujars1 | UNIX for Dummies Questions & Answers | 2 | 07-12-2007 10:56 AM |
| find files and copy into a directory | balireddy_77 | Shell Programming and Scripting | 4 | 04-27-2007 04:38 AM |
| HOw to find and copy | aaajohnson | UNIX for Dummies Questions & Answers | 1 | 05-18-2006 02:41 PM |
| Find directories not containing foo, and copy foo to them | dkaplowitz | Shell Programming and Scripting | 6 | 06-29-2005 09:50 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Help with Find All/Copy Script
Hi Gang, I am an old unix user and just recently returned in the flavor of a Mac. I have tons of pictures in the .orf format and would like to write a script to:
Search the Hard drives for that file type Then, depending on date, copy it to a specific folder If there is an exact copy, only keep one How hard is this to do? Many thanks. I am very happy to be away from MS again! |
|
||||
|
this script should find files in tree structure $whereToFind that are less than 5 days old + copy them to $path_to_specific_folder
$path_to_specific_folder="$HOME/myPhotos"; $whereToFind="/" find $whereToFind -type f -name "*.orf" -mtime -5 -exec cp {} $path_to_specific_folder ";" |
|
||||
|
For avoiding duplicates, you might want to pull just the file names into a list, and generate MD5 sums of all the files in that list. If two files have the same MD5, they are identical (with a probability which is close enough to certainty for most practical purposes). Remove duplicate MD5s, then copy the remaining files. (If the file format makes it unlikely that two different files will have exactly the same size, that might be good enough, and a lot quicker than MD5 to calculate.)
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|