#!/bin/bash if [[ -z "$@" ]]; then echo "Nothing to do!" echo "Usage: jdupes.sh [device label or folder 1] [2] ... [n]" echo "Enclose names including blanks within double quotes." echo "e.g. $ jdupes.sh /media/fred/MX500-2TB . '/m*/f*/Seagate Backup'" echo " will process 2 of Fred's drives and the current folder (".")." exit 1 fi jdupes -r "$@" | { while IFS= read -r file; do if [[ ! -z "$file" ]]; then if [[ ! "$file" == "bytes each" ]]; then sz=$(du "$file") set -- $sz if [[ $1 -gt 100000 ]]; then echo $(du "$file") fi fi fi done } | sort -n > /home/fred/myjdups_sorted.txt echo echo "RESULTS" tail -n 250 /home/fred/myjdups_sorted.txt # Save this to your choice of filename. # Mark the resulting file as executable with # sudo chmod+x .