I have 10 directories with files in them. All files in all directories are named with numbers (0001.jpg, 0002.jpg, 0003.jpg, etc). I want to put them all into one directory. Problem is that they all need to be renamed so the names to not overlap. How can I used command line to go into these directories, rename them and then move them into a new directory with all the others?