Hello, i have many folders with pictures and some of them are duplicates, is there an app that can detect that?

  • 🎧MutatedBass🖱️@beehaw.org
    link
    fedilink
    arrow-up
    4
    ·
    10 months ago

    Here’s a script from GPT4:

    #!/bin/bash
    
    # Create a temporary file for storing file checksums
    tempfile=$(mktemp)
    
    # Generate MD5 checksums for all files in the current directory and its sub-directories
    find . -type f -exec md5sum '{}' \; | sort > $tempfile
    
    # Detect and delete duplicates
    awk 'BEGIN {
        lasthash = "";
        lastfile = "";
    }
    {
        if ($1 == lasthash) {
            print "Deleting duplicate file: " $2;
            system("rm -f \""$2"\"");
        } else {
            lasthash = $1;
            lastfile = $2;
        }
    }' $tempfile
    
    # Clean up
    rm -f $tempfile
    

    This script can be run with Termux from the root of your internal storage. Usually /sdcard or /storage/emulated/0. Do not confuse this with running from root if you are rooted.

    Before using a script that interacts with your files you should backup anything that is important just in case.

    Furthermore, if you comment out:

    system("rm -f \""$2"\"");
    

    By adding a # in front of it like this:

    # system("rm -f \""$2"\"");
    

    You can run the script and see what files the script would delete without actually deleting them. I would recommend doing this as I have not tested this script.

  • MasterBuilder@lemmy.one
    link
    fedilink
    arrow-up
    2
    ·
    10 months ago

    If you’d find one I’d be interested in hearing what it is. As an alternative, you might be able to use a Linux app while connected through MTP.

  • Nkiru Anaya@lemm.ee
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    10 months ago

    MiX file explorer for android does this. It’s free. Not sure if it’s open source though, does anyone know?

    It does use open source libraries.

    Latest version is 6.64.3 beta.

    https://forum.xda-developers.com/t/mixplorer-q-a-and-faq-user-manual.3308582/

    “MiXplorer (Mix of Explorers) is a fast, smooth, beautiful, reliable and fully-featured file manager with a simple and intuitive user interface.” created by XDA member and Recognized Developer @HootanParsa

  • Radiant_sir_radiant@beehaw.org
    link
    fedilink
    arrow-up
    2
    ·
    10 months ago

    FX File Explorer has that functionality (among other cleanup tools) and is generally a great file manager. It’s free with limited functionality after a trial period, or a one-off fee of about three bucks for the Plus version.