🌱 rename files with folder names

Source
#!/bin/bash

for f in `find . -name '*jpg'`
do
    filename=`echo $f|awk -F'/' '{SL = NF-1; TL = NF-2; print $TL "_" $SL  "_" $NF}'`
    cp $f newfolder/$filename
done
Made by Brandon . If you find this project useful you can donate.