How to move files into corresponding folders in bash : I have a folder with files such as:

    20170129-aaa.jpg
    20170130-bbb.jpg
    20170131-ccc.jpg
    20170201-ddd.jpg
    20170202-eee.jpg

I'd like to create folders based on the YYYYMM part of the files, and move the files to its corresponding folder.  (eg. `20170129-aaa.jpg` -> `201701/20170129-aaa.jpg`)
I'm new to bash, my attempts on awk, uniq, substring are all failed.  How can I make this work?  Thanks
