in reply to copy and rename depending on location
cd /test1/da/ for file in */*/*.dat ; do mv $file /newfolder/${file////_} done [download]