remove duplicated roms : Please read this simple script
-
roms path.
/home/pi/RetroPie/roms/mame-mame4allhow do i put a simple script in this folder and run it off command line just execute it and let it run through it using compare method or if statements anything that does the job without slowing it down.
or
compare two folders
/home/pi/RetroPie/roms/mame-mame4all
/home/pi/RetroPie/roms/mame-libretro
compare two folders and remove duplicated .zipmay anybody share a simple script so that i can learn from it.
is retro-pie running of bash script Linux command.
found this in a site
#!/bin/bash declare -A arr shopt -s globstar for file in **; do [[ -f "$file" ]] || continue read cksm _ < <(md5sum "$file") if ((arr[$cksm]++)); then echo "rm $file" fi done
files=(*) count=${#files[@]} for (( i=0 ; i < count ;i++ )); do for (( j=i+1 ; j < count ; j++ )); do if diff -q "${files[i]}" "${files[j]}" >/dev/null ; then echo "${files[i]} and ${files[j]} are the same" fi done done
how do i modify that so it checks both folders and the same name.zip and remove
are these retropie batch script codes that will work.
https://superuser.com/questions/386199/how-to-remove-duplicated-files-in-a-directory
https://www.taniarascia.com/how-to-create-and-use-bash-scripts/ -
roms path.
/home/pi/RetroPie/roms/mame-mame4allhow do i put a simple script in this folder and run it off command line just execute it and let it run through it using compare method or if statements anything that does the job without slowing it down.
or
compare two folders
/home/pi/RetroPie/roms/mame-mame4all
/home/pi/RetroPie/roms/mame-libretro
compare two folders and remove duplicated .zipmay anybody share a simple script so that i can learn from it.
is retro-pie running of bash script Linux command.
found this in a site
#!/bin/bash declare -A arr shopt -s globstar for file in **; do [[ -f "$file" ]] || continue read cksm _ < <(md5sum "$file") if ((arr[$cksm]++)); then echo "rm $file" fi done
files=(*) count=${#files[@]} for (( i=0 ; i < count ;i++ )); do for (( j=i+1 ; j < count ; j++ )); do if diff -q "${files[i]}" "${files[j]}" >/dev/null ; then echo "${files[i]} and ${files[j]} are the same" fi done done
Usage: ./duplicate_removing.sh files/*
#!/bin/bash for target_file in "$@"; do shift for candidate_file in "$@"; do compare=$(diff -q "$target_file" "$candidate_file") if [ -z "$compare" ]; then echo the "$target_file" is a copy "$candidate_file" echo rm -v "$candidate_file" fi done done
this script not tested just copied from another site,how do i modify that so it checks both folders and the same name.zip and remove
are these retropie batch script codes that will work.
https://superuser.com/questions/386199/how-to-remove-duplicated-files-in-a-directory
https://www.taniarascia.com/how-to-create-and-use-bash-scripts/please delete other post it says blocked by askimete spam ? please fix it.
-
MODERATION NOTE: I merged the 2 topics you opened. If you find your posts flagged as spam, try removing the code blocks first when posting.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.