#!/bin/bash dirs=(/home/ramsi/Movies /mnt/Skaro/Movies) find "${dirs[@]}" -type f -printf '%H %P\n' | sed -r 's/\{[^}]+\}.*//' | sort -k1 | uniq -Df1