How to flatten a directory on a qnap nas box

I recently had to flatten a large directory with well over 250 folders. The main reason was that i had installed FireCores mediaplayer onto my Apple Tv 2 and for it to scrape the media information correctly all the files had to be in the same directory. I found some scripts on the web, but could never get them to work. It them dawned on me, why don’t I just create a separate directory and make symbolic links to all the files. This allowed me to keep all my movies in their own folders.

execute from the directory where the symbolic links are to be created.

find dir_of_files -type f | grep “__thumb” -v | while read i; do ln -s “$i” `basename $i` ; done;