I am trying to move specific folders and subfolders within a directory using the below. I can see the folders to move and they are at the location, but I am getting an error. Thank you :).
mv -v /home/cmccabe/Desktop/NGS/API/6-10-2016{bam/{validation,coverage},bedtools /media/cmccabe/"My Book Western Digital"
mv: cannot stat �/home/cmccabe/Desktop/NGS/API/6-10-2016{bam/validation,bedtools': No such file or directory
I think you should use 2 times double quotes, because I could see in between there is space in path provided to mv command, so if directory is having space in it's name itself, could you please try following then.
mv -v /home/cmccabe/Desktop/NGS/API/"6-10-2016{bam/{validation,coverage},bedtools "/media/cmccabe/"My Book Western Digital"
rsync -av /home/cmccabe/Desktop/NGS/API/6-10-2016/bam /home/cmccabe/Desktop/NGS/API/6-10-2016/validation /home/cmccabe/Desktop/NGS/API/6-10-2016/validation /home/cmccabe/Desktop/NGS/API/6-10-2016/bedtools /media/cmccabe/"My Book Western Digital"
The two problems are:
it does not create a folder with the date to save each folder in (in this case 6-10-2016)
it transfers BAM, Coverage, and Validation as 3 seperate folders instead of BAM being the main folder and Coverage and Validation as subfolders.
The combination of mkdir -p and mv seem to be close, the only issue is that coverage and validation are treated as separate directories outside of BAM , rather then inside of it.
mkdir -p "/media/cmccabe/My Book Western Digital/6-10-2016" | mv -v /home/cmccabe/Desktop/NGS/API/6-10-2016/{bam/{validation,coverage},bedtools} "/media/cmccabe/My Book Western Digital/6-10-2016"
Using rsync is close as well except it does not transer the BAM folder and treats coverage and validation as separate directories outside of BAM , rather then inside of it.
6-10-2016
coverage
validation
bedtools
mkdir -p "/media/cmccabe/My Book Western Digital/6-10-2016" | rsync -av /home/cmccabe/Desktop/NGS/API/6-10-2016/{bam/{validation,coverage},bedtools} "/media/cmccabe/My Book Western Digital/6-10-2016"