I have 12 files named dmp_000, dmp_001, etc, all the way to dmp_011. I would like to copy all of them to rdmp_000, rdmp_001, and so on, sequentially so the numbered files coincide. There must be an easy way to do this rather than individually?
Copy Sequential Files
shell;files;filenames;wildcards;cp
I used this command to generate some sample data% for  i in `seq 0 11`;do touch dmp_$(printf %03d $i);done% lsdmp_000  dmp_001  dmp_002  dmp_003  dmp_004  dmp_005  dmp_006  dmp_007  dmp_008  dmp_009  dmp_010  dmp_011To duplicate the files and preserve the original files modify/create dates:% for i in dmp*;do cp -p $i r${i};done% lsdmp_000  dmp_002  dmp_004  dmp_006  dmp_008  dmp_010  rdmp_000  rdmp_002  rdmp_004  rdmp_006  rdmp_008  rdmp_010dmp_001  dmp_003  dmp_005  dmp_007  dmp_009  dmp_011  rdmp_001  rdmp_003  rdmp_005  rdmp_007  rdmp_009  rdmp_011To move the files wdmp* to rdmp*% for i in wdmp*;do newname=$(echo $i|sed 's/^w/r/'); mv $i $newname;doneNOTE: You could also have used @warl0ck's answer for that using the rename command.