Search code examples
file-move

Moving files in bulk to folders according to a key word in the file and folder name


I have several files named like this: Name 39W04150167 7015 0640 0000 2087 5834

I have several folders named like this: 39W04150167

I would like to transfer all files to their respective folders. The folder names and matching key word in the file names are unique and do not repeat.

Any ideas?

Thanks


Solution

  • Assuming your OS is in the unix family,

    $ mv 39W04150167[0-9]* 39W04150167