Bash Script to find/sort/move images/duplicate images from USB drive


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Bash Script to find/sort/move images/duplicate images from USB drive
# 1  
Old 10-16-2014
Bash Script to find/sort/move images/duplicate images from USB drive

Ultimately, I'm looking to create a script that allows me to plug in a usb drive with lots of jpegs on it & copy them over to a folder on my hard drive. So in the process of copying I am looking to hash check them, record dupes to a file, copy only 1 of the identical files (if it doesn't exsist in the hard drive folder already) while renaming any files of the same name that are NOT identical (ie same hash) but copying them over too.
Thanks for any help
# 2  
Old 10-16-2014
I use SHA to identify dups, too. I'd collect all existing files with their hashes by doing something along these lines:

Code:
 (
 for f1 in $( find $PHOTOS -type f -name "*.jpeg" ); do
        shasum $f1;
done
 ) > EXISTING;

then I would get new SHA and grep against existing to discard incoming dups.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating a script to download images from multiple cameras using ghoto2

I should start by saying that I am totally new to linux... I am trying to create a script that downloads images from multiple cameras into a specific folder on my machine. Ideally renaming the images as they are downloaded. I have installed gphoto2 which as a command line interface that... (0 Replies)
Discussion started by: benpems
0 Replies

2. Shell Programming and Scripting

Script to isolate unused images in website

Hi I am sorry if I am in the wrong place! I have been looking for a way to isolate and FTP out of the server hundreds of images which are no longer doing anything there, that is, that are not linked to any page. The only thing I found (free) was the following script. If I am useless at... (7 Replies)
Discussion started by: qim
7 Replies

3. Shell Programming and Scripting

Need to add Birthday images inside shell script

Hi All- I have written a shell script to send birthday wish mail to all my colleagues. I need help from you all in two things, 1. I need to add some 17 birthday images as my team size is 17 i want to send different images for everyone. (I dont know how to do it) 2. I need to send mail... (4 Replies)
Discussion started by: ChandruBala73
4 Replies

4. UNIX for Dummies Questions & Answers

How to find string of file name of images?

Hi & good day, How to use find correctly ? I have several folders, _img1, _img2 etc. Then I want to use the find command to find part of an image name, such as: the string ”modern” which is (at least) in: ”_img2/modern_world2PS220.jpg” Also I want to know _in which folder_ it... (10 Replies)
Discussion started by: OmarKN
10 Replies

5. Shell Programming and Scripting

How to find & auto resize images?

I need a command or mini scripts that can find certain type of images file recursively from the current dir with files of minimum 736 width and resize them by "736 max width, relative height" and replace the source files. I currently have GD installed but can also install Imagemagick if needed, I'm... (5 Replies)
Discussion started by: Frozen77
5 Replies

6. Shell Programming and Scripting

Find all images, append unique prefix to name and move to different directory

Hi, I have a directory with Multiple subdirectories and 1000s of pictures (jpg) in each directory. The problem is that each directory has a 001.jpg in them. I want to append a unique name (the directory_name)would be fine. and then move them to one main backup directory once they have been... (1 Reply)
Discussion started by: kmaq7621
1 Replies

7. Shell Programming and Scripting

Drive backup Images

About once a year I update my scripts and make little tweeks. This is my latest... #! /bin/bash # # OS: Unix/Linux # Name: hda-to-hdc # Ver: 03/01/08 # Purpose: Full disk image copy # By: Jan Zumwalt - www.neatinfo.com - root directory list # # REMARKS: # I use... (1 Reply)
Discussion started by: jwzumwalt
1 Replies

8. Solaris

Flar Images

I once found a document on the web describing how to build partition flar images instead of having just the one large one. I have managed this but am having problems extracting the subsequent flar archives. I ahve built the system from a jumpstart server and now need to add the program images etc... (0 Replies)
Discussion started by: 58fairlane
0 Replies

9. AIX

where to get .bm or .pm images

I'm just trying to get a personal picture for a backdrop on my AIX user account at work. Where does one acquire the .bm or .pm files. How do I create them as an unpriveledged user? There are quite a few jpeg's that I would like to use. (0 Replies)
Discussion started by: trigggl
0 Replies
Login or Register to Ask a Question