Não sei ao usar o xarg, mas pode haver muitas maneiras para Roma, como de costume. aqui minha abordagem por exemplo:
#!/bin/bash SRCDIR="$HOME/Pictures/." # should be : /media/et10000 DST="." # should be : /media/newhdd/photos find ${SRCDIR} -type f -exec file {} \; | grep -o -P '^.+: \w+ image' | cut -d':' -f1|while read fname do echo "FILE: ${fname}" filebase=$(dirname $fname); filenew=$(basename "$fname"); echo "filenew: ${filenew}" ## place here all the mkdir, copy and link BUT take care that ## white spaces and other chars needs to be masked - so place your ## variable into this exact way: "${varname}" like ## ln -s "/media/newhdd/photos/year/$(date +%Y)/${fnamebase}" echo "---" done