The Computer/Software/Marketing Help Thread

Yep.

I’m terrible with Terminal.

I saw this solution - I’ve not tried it; but I think going via terminal, I’ll be looking at potentially a few thousand lines of text filenames, which likely won’t speed much up at all…

Unless I am mistaken?

This is the thing - theres 84,000 files here I am working with. :confused:

Try it on two test folders.
One folder holding a couple of files, the second holding the same files plus some additional ones.
Run the diff tool and see what it reports back, seems to me it will return the non matching files.
man diff - will open the manual for commands to use with the tool and explain what they accomplish.

1 Like

OOF
Although I bet my music folder was not that far off (you should see my book collection too!) took me a couple of hours doing it manually. I bet with photo’s you’ll rarely get a duplication if they still have their og file names, they’ll all be individual. The main problem you’ll have is if you have edited any and have more than one iteration saved under the same name because you edited on different devices.

I was kidding about the books, I have no collection, I was taking the piss out of media bragging, I thought i’d better clarify just in case people thought I was That Guy.

If you do something like this you’ll get 2 CSV files which you can compare in excel. Not on a laptop right now so can’t test but something like this should come close:

ls -R directory1 >> dir1.csv; ls -R directory2.csv >> dir2.csv

The -R flag makes it recursive so it looks in subdirectories as well. You might end up with absolute file paths though.

If you haven’t got it sorted by tonight I could have a bash at a python script for you, it’ll give me something to do.

1 Like

I have doubles of books. I am tht guy.

I don’t have a time limit…Its just a case of organising 15 years of photos and not losing them.

I’ll look into it, though - I’m currently looking up how to change directory with Terminal. lol.

Gimme MS-Dos any day…

The beauty is that iTunes is actually really good at organising and there are good comparison tools out there.
Even if you have 17 version of Territorial Pissings, you have track length, album name, track number, release date and all this other info to help you sort it.

With photos…It is hell. Some have identical filenames (IMG_2020) but are completely different images.

I dunno…maybe manual is the only way here.
That will suck.

1 Like

Copy all the files from drive A to one folder, and files from drive B to another, then do a comparison between those two? Bit of waiting around copying stuff but not much actual work

I did wonder if you have just dumped files from a card onto the computer without renaming them in which case that does make it pretty much impossible without opening the matching files to check if they are indeed the same image.

Plenty of programs that can compare files by content rather than name, metadata etc

You essentially need to loop through all the files on the disorganised drive and see if there are equivalently named files on the organised drive and then compare the contents of the files it finds that are named the same.

I had a crack at a bash script to do it for you.

Provided as is, no warranty, at your own risk etc.

I tested it against one set of folders, each 10gb in size with the same files and 5 missing files. It found them all.

3 Likes

Yeah, only if the music was uploaded with info. Most stuff was ripped from CD on a puter that was not on the net so aside from the stuff that had info I had 60gb of untitled, unknown artist files. Was fun. I’m too stupid to find any other way to sort them than manually.

1 Like

nice

I got this far then got told off for working on my day off.

"""londonskater.py"""
import filecmp
from shutil import copyfile

# Compare dir1 and dir2
compared = filecmp.dircmp('dir1', 'dir2') 

# Copy files that only exist in dir2 to dir1
for file in compared.right_only:
    copyfile(
        'dir2/{}'.format(file),
        'dir1/{}'.format(file))
    print('{} moved from dir2 to dir1'.format(file))

Compares two directories, then copies any files from right to left if the file only exists on the right. Unfortunately it’s not recursive so it’s useless but it was fun for a few mins.

If someone wants to take a crack at it, you could probably make it recursive using compared.report_full_closure() or by doing an os.walk before comparing.

A quick google of filecmp says it actually compares files to see if they’re the same (though I don’t know what “sameness” means), rather than just comparing filenames. But the file copy doesn’t check if a filename already exists in dir1 because I’m lazy.

2 Likes

Damn! Ok. I got to check this

Thank you.

Sorry - lack of checking on here today. Boiler broke/Kerb needed grinding, etc.

Will get stuck in now…

1 Like

I\ve used something exactly like this for mac, but can’t remember the name of it. I think it was this Download FreeFileSync for macOS

Actually I think it was this one Backup & Sync Software Download | GoodSync

Basically you ask it to sync and it will spit out a list of dupes with names etc and you can sort them from there?

I have no idea why you would want to put yourself through the pain of a spcript/CLI for this.

Freefilesync was my first thought but I tested it out and it takes folder structure into account when comparing two folders, so it wouldn’t work in this instance

1 Like

You can actually do this in finder, I seem to remember having to do it. Don’t have a mac to hand but I seem to remember a little plus top right of finder where you can add miodifiers to search. You set search to search both folders simultaneously, then sort alphabetically, then you can find dupes that way.

Ah yes, it’s called a smart folder or something

1 Like