I am trying to copy only the files that match the pattern player00_0[1..5]*.*
where [1..5]
signifies files with a 1,2,3,4, or 5 at that position in the filename. There are 40K files in the source dir so we can not use any bash globs
for this job.
Here is my attempt to do that:
indir=playout40kem
outdir=visible5k
rsync -am --include='player00_01*.*' --include='player00_02*.*'
--include='player00_03*.*' --include='player00_04*.*'
--include='player00_05*.*' $indir/ $outdir
However the result is that all files are copied. What is the correct way to do this filtering?
rsync
patterns and please quote your variables, e.g.rsync -am --include='player00_0[1-5]*.*' --exclude="*" "$indir"/ "$outdir"
– Freddy Dec 06 '20 at 23:52