I am trying to move all files in multiply nested directories into one directory. There are a few posts on this same topic which I followed. The command I used was this:
find ./train/ -type f -print0 | xargs -0 mv -t ./newTrain
where train is the folder with the already existing files, and newTrain is the one I want to copy to. The command "somewhat" worked. The problem I have is that many of the files (and there are A LOT of them) have the exact same name. What seems to have happened is that the first file with a given name moved, then all subsequent files with the same name did not move. Here is a sample output from my command line:
mv: will not overwrite just-created './newTrain/000030.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0080/01-04-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-37331/501-T2WTSEAX-47262/000030.dcm'
mv: will not overwrite just-created './newTrain/000031.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0080/01-04-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-37331/501-T2WTSEAX-47262/000031.dcm'
mv: will not overwrite just-created './newTrain/000000.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000000.dcm'
mv: will not overwrite just-created './newTrain/000001.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000001.dcm'
mv: will not overwrite just-created './newTrain/000002.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000002.dcm'
mv: will not overwrite just-created './newTrain/000003.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000003.dcm'
mv: will not overwrite just-created './newTrain/000004.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000004.dcm'
mv: will not overwrite just-created './newTrain/000005.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000005.dcm'
mv: will not overwrite just-created './newTrain/000006.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000006.dcm'
mv: will not overwrite just-created './newTrain/000007.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000007.dcm'
mv: will not overwrite just-created './newTrain/000008.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000008.dcm'
mv: will not overwrite just-created './newTrain/000009.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000009.dcm'
mv: will not overwrite just-created './newTrain/000010.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000010.dcm'
mv: will not overwrite just-created './newTrain/000011.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000011.dcm'
mv: will not overwrite just-created './newTrain/000012.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000012.dcm'
mv: will not overwrite just-created './newTrain/000013.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000013.dcm'
mv: will not overwrite just-created './newTrain/000014.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000014.dcm'
mv: will not overwrite just-created './newTrain/000015.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000015.dcm'
mv: will not overwrite just-created './newTrain/000016.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000016.dcm'
mv: will not overwrite just-created './newTrain/000017.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000017.dcm'
mv: will not overwrite just-created './newTrain/000018.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000018.dcm'
mv: will not overwrite just-created './newTrain/000019.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000019.dcm'
mv: will not overwrite just-created './newTrain/000020.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000020.dcm'
mv: will not overwrite just-created './newTrain/000021.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000021.dcm'
mv: will not overwrite just-created './newTrain/000022.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000022.dcm'
mv: will not overwrite just-created './newTrain/000023.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000023.dcm'
mv: will not overwrite just-created './newTrain/000024.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000024.dcm'
mv: will not overwrite just-created './newTrain/000025.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000025.dcm'
mv: will not overwrite just-created './newTrain/000026.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000026.dcm'
mv: will not overwrite just-created './newTrain/000027.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000027.dcm'
mv: will not overwrite just-created './newTrain/000028.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000028.dcm'
mv: will not overwrite just-created './newTrain/000029.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000029.dcm'
mv: will not overwrite just-created './newTrain/000030.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000030.dcm'
mv: will not overwrite just-created './newTrain/000031.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000031.dcm'
mv: will not overwrite just-created './newTrain/000030.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0080/01-04-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-37331/501-T2WTSEAX-47262/000030.dcm'
mv: will not overwrite just-created './newTrain/000031.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0080/01-04-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-37331/501-T2WTSEAX-47262/000031.dcm'
mv: will not overwrite just-created './newTrain/000000.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000000.dcm'
mv: will not overwrite just-created './newTrain/000001.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000001.dcm'
mv: will not overwrite just-created './newTrain/000002.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000002.dcm'
mv: will not overwrite just-created './newTrain/000003.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000003.dcm'
mv: will not overwrite just-created './newTrain/000004.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000004.dcm'
mv: will not overwrite just-created './newTrain/000005.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000005.dcm'
mv: will not overwrite just-created './newTrain/000006.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000006.dcm'
mv: will not overwrite just-created './newTrain/000007.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000007.dcm'
mv: will not overwrite just-created './newTrain/000008.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000008.dcm'
mv: will not overwrite just-created './newTrain/000009.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000009.dcm'
mv: will not overwrite just-created './newTrain/000010.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000010.dcm'
mv: will not overwrite just-created './newTrain/000011.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000011.dcm'
mv: will not overwrite just-created './newTrain/000012.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000012.dcm'
mv: will not overwrite just-created './newTrain/000013.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000013.dcm'
mv: will not overwrite just-created './newTrain/000014.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000014.dcm'
mv: will not overwrite just-created './newTrain/000015.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000015.dcm'
mv: will not overwrite just-created './newTrain/000016.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000016.dcm'
mv: will not overwrite just-created './newTrain/000017.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000017.dcm'
mv: will not overwrite just-created './newTrain/000018.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000018.dcm'
mv: will not overwrite just-created './newTrain/000019.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000019.dcm'
mv: will not overwrite just-created './newTrain/000020.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000020.dcm'
mv: will not overwrite just-created './newTrain/000021.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000021.dcm'
mv: will not overwrite just-created './newTrain/000022.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000022.dcm'
mv: will not overwrite just-created './newTrain/000023.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000023.dcm'
mv: will not overwrite just-created './newTrain/000024.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000024.dcm'
mv: will not overwrite just-created './newTrain/000025.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000025.dcm'
mv: will not overwrite just-created './newTrain/000026.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000026.dcm'
mv: will not overwrite just-created './newTrain/000027.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000027.dcm'
mv: will not overwrite just-created './newTrain/000028.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000028.dcm'
mv: will not overwrite just-created './newTrain/000029.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000029.dcm'
mv: will not overwrite just-created './newTrain/000030.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000030.dcm'
mv: will not overwrite just-created './newTrain/000031.dcm' with './train/PROSTATE-DIAGNOSIS/ProstateDx-01-0082/02-09-2010-MRI PROSTATE WITH AND WITHOUT CONTRAST-62402/501-T2WTSEAX-04339/000031.dcm'
Any ideas on how to fix this?
1 Answers