Parallel move keeping folder structure along with files in it

The below will move all the files in the directory dir to the destination using parallel and create a log, however will not keep them in the directory. I have tried mkdir -p but that does not seem to work or at least I can not seem to get it (as it deletes others files when I use it). What is the correct way to move the 3 files into the same directory? Thank you :).

dir="/home/cmccabe/Downloads/snp"
cd "$dir"
parallel -j10 --progress mv -v {} /home/cmccabe/Desktop/indel/ ::: * > /home/cmccabe/medex.logs/archive.log

Folder structure:

FolderName   --- dir
|
file1
file2
file3

Desired after move:

FolderName
|
3 files in it

Your hard drive does not work in parallel. There is no point or benefit in running cp, mv, rsync, rm, rmdir, etc in parallel. They will still have to wait for each other. Trying to run them in parallel will actually slow it down and cause fragmentation. Don't do it.

Running tar in parallel - as in your other thread - only worked because bzip2 is so slow that the disk was waiting for the CPU, not vice versa. That's an unusual situation and not at all true of basic file utilities.

1 Like

Thank you very much :).