Selectively batch copy files
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I've got a directory containing these files:
RG000909-A1_1.jpg
RG000909-A2_1.jpg
RG000909-A3_1.jpg
RG000909-A4_1.jpg
RG000909-A5_1.jpg
RG000909-A6_1.jpg
RG000909-A7_1.jpg
RG000909-A8_1.jpg
RG000909-A9_1.jpg
RG000909-A10_1.jpg
RG000909-B1_1.jpg
RG000909-B2_1.jpg
RG000909-B3_1.jpg
RG000909-B4_1.jpg
RG000909-B5_1.jpg
RG000909-B6_1.jpg
RG000909-B7_1.jpg
RG000909-B8_1.jpg
RG000909-B9_1.jpg
RG000909-B10_1.jpg
RG000909-C1_1.jpg
RG000909-C2_1.jpg
RG000909-C3_1.jpg
RG000909-C4_1.jpg
RG000909-C5_1.jpg
RG000909-C6_1.jpg
RG000909-C7_1.jpg
RG000909-C8_1.jpg
RG000909-C9_1.jpg
RG000909-C10_1.jpg
RG000909-D1_1.jpg
RG000909-D2_1.jpg
RG000909-D3_1.jpg
RG000909-D4_1.jpg
RG000909-D5_1.jpg
RG000909-D6_1.jpg
RG000909-D7_1.jpg
RG000909-D8_1.jpg
RG000909-D9_1.jpg
RG000909-D10_1.jpg
RG000909-E1_1.jpg
RG000909-E2_1.jpg
RG000909-E3_1.jpg
RG000909-E4_1.jpg
RG000909-E5_1.jpg
RG000909-E6_1.jpg
RG000909-E7_1.jpg
RG000909-E8_1.jpg
RG000909-E9_1.jpg
RG000909-E10_1.jpg
RG000909-F1_1.jpg
RG000909-F2_1.jpg
RG000909-F3_1.jpg
RG000909-F4_1.jpg
RG000909-F5_1.jpg
RG000909-F6_1.jpg
RG000909-F7_1.jpg
RG000909-F8_1.jpg
RG000909-F9_1.jpg
RG000909-F10_1.jpg
RG000909-G1_1.jpg
RG000909-G2_1.jpg
RG000909-G3_1.jpg
RG000909-G4_1.jpg
RG000909-G5_1.jpg
RG000909-G6_1.jpg
RG000909-G7_1.jpg
RG000909-G8_1.jpg
RG000909-G9_1.jpg
RG000909-G10_1.jpg
RG000909-H1_1.jpg
RG000909-H2_1.jpg
RG000909-H3_1.jpg
RG000909-H4_1.jpg
RG000909-H5_1.jpg
RG000909-H6_1.jpg
RG000909-H7_1.jpg
RG000909-H8_1.jpg
RG000909-H9_1.jpg
RG000909-H10_1.jpg
What single command could I use to copy out
1)
RG000909-A1_1.jpg
RG000909-A2_1.jpg
RG000909-A3_1.jpg
RG000909-A4_1.jpg
RG000909-A5_1.jpg
RG000909-B1_1.jpg
RG000909-B2_1.jpg
RG000909-B3_1.jpg
RG000909-B4_1.jpg
RG000909-B5_1.jpg
RG000909-C1_1.jpg
RG000909-C2_1.jpg
RG000909-C3_1.jpg
RG000909-C4_1.jpg
RG000909-C5_1.jpg
RG000909-D1_1.jpg
RG000909-D2_1.jpg
RG000909-D3_1.jpg
RG000909-D4_1.jpg
RG000909-D5_1.jpg
RG000909-E1_1.jpg
RG000909-E2_1.jpg
RG000909-E3_1.jpg
RG000909-E4_1.jpg
RG000909-E5_1.jpg
RG000909-F1_1.jpg
RG000909-F2_1.jpg
RG000909-F3_1.jpg
RG000909-F4_1.jpg
RG000909-F5_1.jpg
RG000909-G1_1.jpg
RG000909-G2_1.jpg
RG000909-G3_1.jpg
RG000909-G4_1.jpg
RG000909-G5_1.jpg
RG000909-H1_1.jpg
RG000909-H2_1.jpg
RG000909-H3_1.jpg
RG000909-H4_1.jpg
RG000909-H5_1.jpg
or 2)
RG000909-A6_1.jpg
RG000909-A7_1.jpg
RG000909-A8_1.jpg
RG000909-A9_1.jpg
RG000909-A10_1.jpg
RG000909-B6_1.jpg
RG000909-B7_1.jpg
RG000909-B8_1.jpg
RG000909-B9_1.jpg
RG000909-B10_1.jpg
RG000909-C6_1.jpg
RG000909-C7_1.jpg
RG000909-C8_1.jpg
RG000909-C9_1.jpg
RG000909-C10_1.jpg
RG000909-D6_1.jpg
RG000909-D7_1.jpg
RG000909-D8_1.jpg
RG000909-D9_1.jpg
RG000909-D10_1.jpg
RG000909-E6_1.jpg
RG000909-E7_1.jpg
RG000909-E8_1.jpg
RG000909-E9_1.jpg
RG000909-E10_1.jpg
RG000909-F6_1.jpg
RG000909-F7_1.jpg
RG000909-F8_1.jpg
RG000909-F9_1.jpg
RG000909-F10_1.jpg
RG000909-G6_1.jpg
RG000909-G7_1.jpg
RG000909-G8_1.jpg
RG000909-G9_1.jpg
RG000909-G10_1.jpg
RG000909-H6_1.jpg
RG000909-H7_1.jpg
RG000909-H8_1.jpg
RG000909-H9_1.jpg
RG000909-H10_1.jpg
rsync scp batch-jobs
add a comment |Â
up vote
0
down vote
favorite
I've got a directory containing these files:
RG000909-A1_1.jpg
RG000909-A2_1.jpg
RG000909-A3_1.jpg
RG000909-A4_1.jpg
RG000909-A5_1.jpg
RG000909-A6_1.jpg
RG000909-A7_1.jpg
RG000909-A8_1.jpg
RG000909-A9_1.jpg
RG000909-A10_1.jpg
RG000909-B1_1.jpg
RG000909-B2_1.jpg
RG000909-B3_1.jpg
RG000909-B4_1.jpg
RG000909-B5_1.jpg
RG000909-B6_1.jpg
RG000909-B7_1.jpg
RG000909-B8_1.jpg
RG000909-B9_1.jpg
RG000909-B10_1.jpg
RG000909-C1_1.jpg
RG000909-C2_1.jpg
RG000909-C3_1.jpg
RG000909-C4_1.jpg
RG000909-C5_1.jpg
RG000909-C6_1.jpg
RG000909-C7_1.jpg
RG000909-C8_1.jpg
RG000909-C9_1.jpg
RG000909-C10_1.jpg
RG000909-D1_1.jpg
RG000909-D2_1.jpg
RG000909-D3_1.jpg
RG000909-D4_1.jpg
RG000909-D5_1.jpg
RG000909-D6_1.jpg
RG000909-D7_1.jpg
RG000909-D8_1.jpg
RG000909-D9_1.jpg
RG000909-D10_1.jpg
RG000909-E1_1.jpg
RG000909-E2_1.jpg
RG000909-E3_1.jpg
RG000909-E4_1.jpg
RG000909-E5_1.jpg
RG000909-E6_1.jpg
RG000909-E7_1.jpg
RG000909-E8_1.jpg
RG000909-E9_1.jpg
RG000909-E10_1.jpg
RG000909-F1_1.jpg
RG000909-F2_1.jpg
RG000909-F3_1.jpg
RG000909-F4_1.jpg
RG000909-F5_1.jpg
RG000909-F6_1.jpg
RG000909-F7_1.jpg
RG000909-F8_1.jpg
RG000909-F9_1.jpg
RG000909-F10_1.jpg
RG000909-G1_1.jpg
RG000909-G2_1.jpg
RG000909-G3_1.jpg
RG000909-G4_1.jpg
RG000909-G5_1.jpg
RG000909-G6_1.jpg
RG000909-G7_1.jpg
RG000909-G8_1.jpg
RG000909-G9_1.jpg
RG000909-G10_1.jpg
RG000909-H1_1.jpg
RG000909-H2_1.jpg
RG000909-H3_1.jpg
RG000909-H4_1.jpg
RG000909-H5_1.jpg
RG000909-H6_1.jpg
RG000909-H7_1.jpg
RG000909-H8_1.jpg
RG000909-H9_1.jpg
RG000909-H10_1.jpg
What single command could I use to copy out
1)
RG000909-A1_1.jpg
RG000909-A2_1.jpg
RG000909-A3_1.jpg
RG000909-A4_1.jpg
RG000909-A5_1.jpg
RG000909-B1_1.jpg
RG000909-B2_1.jpg
RG000909-B3_1.jpg
RG000909-B4_1.jpg
RG000909-B5_1.jpg
RG000909-C1_1.jpg
RG000909-C2_1.jpg
RG000909-C3_1.jpg
RG000909-C4_1.jpg
RG000909-C5_1.jpg
RG000909-D1_1.jpg
RG000909-D2_1.jpg
RG000909-D3_1.jpg
RG000909-D4_1.jpg
RG000909-D5_1.jpg
RG000909-E1_1.jpg
RG000909-E2_1.jpg
RG000909-E3_1.jpg
RG000909-E4_1.jpg
RG000909-E5_1.jpg
RG000909-F1_1.jpg
RG000909-F2_1.jpg
RG000909-F3_1.jpg
RG000909-F4_1.jpg
RG000909-F5_1.jpg
RG000909-G1_1.jpg
RG000909-G2_1.jpg
RG000909-G3_1.jpg
RG000909-G4_1.jpg
RG000909-G5_1.jpg
RG000909-H1_1.jpg
RG000909-H2_1.jpg
RG000909-H3_1.jpg
RG000909-H4_1.jpg
RG000909-H5_1.jpg
or 2)
RG000909-A6_1.jpg
RG000909-A7_1.jpg
RG000909-A8_1.jpg
RG000909-A9_1.jpg
RG000909-A10_1.jpg
RG000909-B6_1.jpg
RG000909-B7_1.jpg
RG000909-B8_1.jpg
RG000909-B9_1.jpg
RG000909-B10_1.jpg
RG000909-C6_1.jpg
RG000909-C7_1.jpg
RG000909-C8_1.jpg
RG000909-C9_1.jpg
RG000909-C10_1.jpg
RG000909-D6_1.jpg
RG000909-D7_1.jpg
RG000909-D8_1.jpg
RG000909-D9_1.jpg
RG000909-D10_1.jpg
RG000909-E6_1.jpg
RG000909-E7_1.jpg
RG000909-E8_1.jpg
RG000909-E9_1.jpg
RG000909-E10_1.jpg
RG000909-F6_1.jpg
RG000909-F7_1.jpg
RG000909-F8_1.jpg
RG000909-F9_1.jpg
RG000909-F10_1.jpg
RG000909-G6_1.jpg
RG000909-G7_1.jpg
RG000909-G8_1.jpg
RG000909-G9_1.jpg
RG000909-G10_1.jpg
RG000909-H6_1.jpg
RG000909-H7_1.jpg
RG000909-H8_1.jpg
RG000909-H9_1.jpg
RG000909-H10_1.jpg
rsync scp batch-jobs
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I've got a directory containing these files:
RG000909-A1_1.jpg
RG000909-A2_1.jpg
RG000909-A3_1.jpg
RG000909-A4_1.jpg
RG000909-A5_1.jpg
RG000909-A6_1.jpg
RG000909-A7_1.jpg
RG000909-A8_1.jpg
RG000909-A9_1.jpg
RG000909-A10_1.jpg
RG000909-B1_1.jpg
RG000909-B2_1.jpg
RG000909-B3_1.jpg
RG000909-B4_1.jpg
RG000909-B5_1.jpg
RG000909-B6_1.jpg
RG000909-B7_1.jpg
RG000909-B8_1.jpg
RG000909-B9_1.jpg
RG000909-B10_1.jpg
RG000909-C1_1.jpg
RG000909-C2_1.jpg
RG000909-C3_1.jpg
RG000909-C4_1.jpg
RG000909-C5_1.jpg
RG000909-C6_1.jpg
RG000909-C7_1.jpg
RG000909-C8_1.jpg
RG000909-C9_1.jpg
RG000909-C10_1.jpg
RG000909-D1_1.jpg
RG000909-D2_1.jpg
RG000909-D3_1.jpg
RG000909-D4_1.jpg
RG000909-D5_1.jpg
RG000909-D6_1.jpg
RG000909-D7_1.jpg
RG000909-D8_1.jpg
RG000909-D9_1.jpg
RG000909-D10_1.jpg
RG000909-E1_1.jpg
RG000909-E2_1.jpg
RG000909-E3_1.jpg
RG000909-E4_1.jpg
RG000909-E5_1.jpg
RG000909-E6_1.jpg
RG000909-E7_1.jpg
RG000909-E8_1.jpg
RG000909-E9_1.jpg
RG000909-E10_1.jpg
RG000909-F1_1.jpg
RG000909-F2_1.jpg
RG000909-F3_1.jpg
RG000909-F4_1.jpg
RG000909-F5_1.jpg
RG000909-F6_1.jpg
RG000909-F7_1.jpg
RG000909-F8_1.jpg
RG000909-F9_1.jpg
RG000909-F10_1.jpg
RG000909-G1_1.jpg
RG000909-G2_1.jpg
RG000909-G3_1.jpg
RG000909-G4_1.jpg
RG000909-G5_1.jpg
RG000909-G6_1.jpg
RG000909-G7_1.jpg
RG000909-G8_1.jpg
RG000909-G9_1.jpg
RG000909-G10_1.jpg
RG000909-H1_1.jpg
RG000909-H2_1.jpg
RG000909-H3_1.jpg
RG000909-H4_1.jpg
RG000909-H5_1.jpg
RG000909-H6_1.jpg
RG000909-H7_1.jpg
RG000909-H8_1.jpg
RG000909-H9_1.jpg
RG000909-H10_1.jpg
What single command could I use to copy out
1)
RG000909-A1_1.jpg
RG000909-A2_1.jpg
RG000909-A3_1.jpg
RG000909-A4_1.jpg
RG000909-A5_1.jpg
RG000909-B1_1.jpg
RG000909-B2_1.jpg
RG000909-B3_1.jpg
RG000909-B4_1.jpg
RG000909-B5_1.jpg
RG000909-C1_1.jpg
RG000909-C2_1.jpg
RG000909-C3_1.jpg
RG000909-C4_1.jpg
RG000909-C5_1.jpg
RG000909-D1_1.jpg
RG000909-D2_1.jpg
RG000909-D3_1.jpg
RG000909-D4_1.jpg
RG000909-D5_1.jpg
RG000909-E1_1.jpg
RG000909-E2_1.jpg
RG000909-E3_1.jpg
RG000909-E4_1.jpg
RG000909-E5_1.jpg
RG000909-F1_1.jpg
RG000909-F2_1.jpg
RG000909-F3_1.jpg
RG000909-F4_1.jpg
RG000909-F5_1.jpg
RG000909-G1_1.jpg
RG000909-G2_1.jpg
RG000909-G3_1.jpg
RG000909-G4_1.jpg
RG000909-G5_1.jpg
RG000909-H1_1.jpg
RG000909-H2_1.jpg
RG000909-H3_1.jpg
RG000909-H4_1.jpg
RG000909-H5_1.jpg
or 2)
RG000909-A6_1.jpg
RG000909-A7_1.jpg
RG000909-A8_1.jpg
RG000909-A9_1.jpg
RG000909-A10_1.jpg
RG000909-B6_1.jpg
RG000909-B7_1.jpg
RG000909-B8_1.jpg
RG000909-B9_1.jpg
RG000909-B10_1.jpg
RG000909-C6_1.jpg
RG000909-C7_1.jpg
RG000909-C8_1.jpg
RG000909-C9_1.jpg
RG000909-C10_1.jpg
RG000909-D6_1.jpg
RG000909-D7_1.jpg
RG000909-D8_1.jpg
RG000909-D9_1.jpg
RG000909-D10_1.jpg
RG000909-E6_1.jpg
RG000909-E7_1.jpg
RG000909-E8_1.jpg
RG000909-E9_1.jpg
RG000909-E10_1.jpg
RG000909-F6_1.jpg
RG000909-F7_1.jpg
RG000909-F8_1.jpg
RG000909-F9_1.jpg
RG000909-F10_1.jpg
RG000909-G6_1.jpg
RG000909-G7_1.jpg
RG000909-G8_1.jpg
RG000909-G9_1.jpg
RG000909-G10_1.jpg
RG000909-H6_1.jpg
RG000909-H7_1.jpg
RG000909-H8_1.jpg
RG000909-H9_1.jpg
RG000909-H10_1.jpg
rsync scp batch-jobs
I've got a directory containing these files:
RG000909-A1_1.jpg
RG000909-A2_1.jpg
RG000909-A3_1.jpg
RG000909-A4_1.jpg
RG000909-A5_1.jpg
RG000909-A6_1.jpg
RG000909-A7_1.jpg
RG000909-A8_1.jpg
RG000909-A9_1.jpg
RG000909-A10_1.jpg
RG000909-B1_1.jpg
RG000909-B2_1.jpg
RG000909-B3_1.jpg
RG000909-B4_1.jpg
RG000909-B5_1.jpg
RG000909-B6_1.jpg
RG000909-B7_1.jpg
RG000909-B8_1.jpg
RG000909-B9_1.jpg
RG000909-B10_1.jpg
RG000909-C1_1.jpg
RG000909-C2_1.jpg
RG000909-C3_1.jpg
RG000909-C4_1.jpg
RG000909-C5_1.jpg
RG000909-C6_1.jpg
RG000909-C7_1.jpg
RG000909-C8_1.jpg
RG000909-C9_1.jpg
RG000909-C10_1.jpg
RG000909-D1_1.jpg
RG000909-D2_1.jpg
RG000909-D3_1.jpg
RG000909-D4_1.jpg
RG000909-D5_1.jpg
RG000909-D6_1.jpg
RG000909-D7_1.jpg
RG000909-D8_1.jpg
RG000909-D9_1.jpg
RG000909-D10_1.jpg
RG000909-E1_1.jpg
RG000909-E2_1.jpg
RG000909-E3_1.jpg
RG000909-E4_1.jpg
RG000909-E5_1.jpg
RG000909-E6_1.jpg
RG000909-E7_1.jpg
RG000909-E8_1.jpg
RG000909-E9_1.jpg
RG000909-E10_1.jpg
RG000909-F1_1.jpg
RG000909-F2_1.jpg
RG000909-F3_1.jpg
RG000909-F4_1.jpg
RG000909-F5_1.jpg
RG000909-F6_1.jpg
RG000909-F7_1.jpg
RG000909-F8_1.jpg
RG000909-F9_1.jpg
RG000909-F10_1.jpg
RG000909-G1_1.jpg
RG000909-G2_1.jpg
RG000909-G3_1.jpg
RG000909-G4_1.jpg
RG000909-G5_1.jpg
RG000909-G6_1.jpg
RG000909-G7_1.jpg
RG000909-G8_1.jpg
RG000909-G9_1.jpg
RG000909-G10_1.jpg
RG000909-H1_1.jpg
RG000909-H2_1.jpg
RG000909-H3_1.jpg
RG000909-H4_1.jpg
RG000909-H5_1.jpg
RG000909-H6_1.jpg
RG000909-H7_1.jpg
RG000909-H8_1.jpg
RG000909-H9_1.jpg
RG000909-H10_1.jpg
What single command could I use to copy out
1)
RG000909-A1_1.jpg
RG000909-A2_1.jpg
RG000909-A3_1.jpg
RG000909-A4_1.jpg
RG000909-A5_1.jpg
RG000909-B1_1.jpg
RG000909-B2_1.jpg
RG000909-B3_1.jpg
RG000909-B4_1.jpg
RG000909-B5_1.jpg
RG000909-C1_1.jpg
RG000909-C2_1.jpg
RG000909-C3_1.jpg
RG000909-C4_1.jpg
RG000909-C5_1.jpg
RG000909-D1_1.jpg
RG000909-D2_1.jpg
RG000909-D3_1.jpg
RG000909-D4_1.jpg
RG000909-D5_1.jpg
RG000909-E1_1.jpg
RG000909-E2_1.jpg
RG000909-E3_1.jpg
RG000909-E4_1.jpg
RG000909-E5_1.jpg
RG000909-F1_1.jpg
RG000909-F2_1.jpg
RG000909-F3_1.jpg
RG000909-F4_1.jpg
RG000909-F5_1.jpg
RG000909-G1_1.jpg
RG000909-G2_1.jpg
RG000909-G3_1.jpg
RG000909-G4_1.jpg
RG000909-G5_1.jpg
RG000909-H1_1.jpg
RG000909-H2_1.jpg
RG000909-H3_1.jpg
RG000909-H4_1.jpg
RG000909-H5_1.jpg
or 2)
RG000909-A6_1.jpg
RG000909-A7_1.jpg
RG000909-A8_1.jpg
RG000909-A9_1.jpg
RG000909-A10_1.jpg
RG000909-B6_1.jpg
RG000909-B7_1.jpg
RG000909-B8_1.jpg
RG000909-B9_1.jpg
RG000909-B10_1.jpg
RG000909-C6_1.jpg
RG000909-C7_1.jpg
RG000909-C8_1.jpg
RG000909-C9_1.jpg
RG000909-C10_1.jpg
RG000909-D6_1.jpg
RG000909-D7_1.jpg
RG000909-D8_1.jpg
RG000909-D9_1.jpg
RG000909-D10_1.jpg
RG000909-E6_1.jpg
RG000909-E7_1.jpg
RG000909-E8_1.jpg
RG000909-E9_1.jpg
RG000909-E10_1.jpg
RG000909-F6_1.jpg
RG000909-F7_1.jpg
RG000909-F8_1.jpg
RG000909-F9_1.jpg
RG000909-F10_1.jpg
RG000909-G6_1.jpg
RG000909-G7_1.jpg
RG000909-G8_1.jpg
RG000909-G9_1.jpg
RG000909-G10_1.jpg
RG000909-H6_1.jpg
RG000909-H7_1.jpg
RG000909-H8_1.jpg
RG000909-H9_1.jpg
RG000909-H10_1.jpg
rsync scp batch-jobs
asked Jan 5 at 6:47
user165209
3517
3517
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
1
down vote
accepted
cp *[A-H][1-5]_*.jpg dest/
and
cp *[A-H][6-9]*.jpg *[A-H]10_*.jpg dest/
respectively.
For rsync
and scp
, the command is similar.
Hey Weijun, I also need to make [A-H][10-12]_.jpg work as well...but it doesnt seem to handle double digits in the second bracket very well. Any ideas on how to make it work?
â user165209
Jan 5 at 21:35
Just use*[A-H]1[0-2]_*.jpg
.
â Weijun Zhou
Jan 5 at 21:50
add a comment |Â
up vote
1
down vote
All file names could be generated with (in bash):
printf '%s/n' RG000909-A..H1..10_1.jpg
The list 1 will be created with
printf '%s/n' RG000909-A..H1..5_1.jpg
And list 2 will be created with:
printf '%s/n' RG000909-A..H6..10_1.jpg
The files could be copied with rsync with (list 1 as an example):
rsync -avz RG000909-A..H1..5_1.jpg dest/
add a comment |Â
up vote
0
down vote
I have done by using combination awk,sed and cp command.Tested it worked fine
Below are commands for list1 and list2 copying into destination directory
Destination directory and source directory You need to specify in the command
For list1
ls -ltr sourcedirectory_path |sed -n '/RG000909-[A-H][1-5]1_/p' | awk 'print "cp -rvfp" " " $1 " " "/Destination_directory/"' | sh
For list 2
ls -ltr sourcedirectory_path |sed -n '/RG000909-[A-H][1-5]_/!p' | awk 'print "cp -rvfp" " " $1 " " "/Destination_directory/"' | sh
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
cp *[A-H][1-5]_*.jpg dest/
and
cp *[A-H][6-9]*.jpg *[A-H]10_*.jpg dest/
respectively.
For rsync
and scp
, the command is similar.
Hey Weijun, I also need to make [A-H][10-12]_.jpg work as well...but it doesnt seem to handle double digits in the second bracket very well. Any ideas on how to make it work?
â user165209
Jan 5 at 21:35
Just use*[A-H]1[0-2]_*.jpg
.
â Weijun Zhou
Jan 5 at 21:50
add a comment |Â
up vote
1
down vote
accepted
cp *[A-H][1-5]_*.jpg dest/
and
cp *[A-H][6-9]*.jpg *[A-H]10_*.jpg dest/
respectively.
For rsync
and scp
, the command is similar.
Hey Weijun, I also need to make [A-H][10-12]_.jpg work as well...but it doesnt seem to handle double digits in the second bracket very well. Any ideas on how to make it work?
â user165209
Jan 5 at 21:35
Just use*[A-H]1[0-2]_*.jpg
.
â Weijun Zhou
Jan 5 at 21:50
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
cp *[A-H][1-5]_*.jpg dest/
and
cp *[A-H][6-9]*.jpg *[A-H]10_*.jpg dest/
respectively.
For rsync
and scp
, the command is similar.
cp *[A-H][1-5]_*.jpg dest/
and
cp *[A-H][6-9]*.jpg *[A-H]10_*.jpg dest/
respectively.
For rsync
and scp
, the command is similar.
answered Jan 5 at 6:49
Weijun Zhou
1,434119
1,434119
Hey Weijun, I also need to make [A-H][10-12]_.jpg work as well...but it doesnt seem to handle double digits in the second bracket very well. Any ideas on how to make it work?
â user165209
Jan 5 at 21:35
Just use*[A-H]1[0-2]_*.jpg
.
â Weijun Zhou
Jan 5 at 21:50
add a comment |Â
Hey Weijun, I also need to make [A-H][10-12]_.jpg work as well...but it doesnt seem to handle double digits in the second bracket very well. Any ideas on how to make it work?
â user165209
Jan 5 at 21:35
Just use*[A-H]1[0-2]_*.jpg
.
â Weijun Zhou
Jan 5 at 21:50
Hey Weijun, I also need to make [A-H][10-12]_.jpg work as well...but it doesnt seem to handle double digits in the second bracket very well. Any ideas on how to make it work?
â user165209
Jan 5 at 21:35
Hey Weijun, I also need to make [A-H][10-12]_.jpg work as well...but it doesnt seem to handle double digits in the second bracket very well. Any ideas on how to make it work?
â user165209
Jan 5 at 21:35
Just use
*[A-H]1[0-2]_*.jpg
.â Weijun Zhou
Jan 5 at 21:50
Just use
*[A-H]1[0-2]_*.jpg
.â Weijun Zhou
Jan 5 at 21:50
add a comment |Â
up vote
1
down vote
All file names could be generated with (in bash):
printf '%s/n' RG000909-A..H1..10_1.jpg
The list 1 will be created with
printf '%s/n' RG000909-A..H1..5_1.jpg
And list 2 will be created with:
printf '%s/n' RG000909-A..H6..10_1.jpg
The files could be copied with rsync with (list 1 as an example):
rsync -avz RG000909-A..H1..5_1.jpg dest/
add a comment |Â
up vote
1
down vote
All file names could be generated with (in bash):
printf '%s/n' RG000909-A..H1..10_1.jpg
The list 1 will be created with
printf '%s/n' RG000909-A..H1..5_1.jpg
And list 2 will be created with:
printf '%s/n' RG000909-A..H6..10_1.jpg
The files could be copied with rsync with (list 1 as an example):
rsync -avz RG000909-A..H1..5_1.jpg dest/
add a comment |Â
up vote
1
down vote
up vote
1
down vote
All file names could be generated with (in bash):
printf '%s/n' RG000909-A..H1..10_1.jpg
The list 1 will be created with
printf '%s/n' RG000909-A..H1..5_1.jpg
And list 2 will be created with:
printf '%s/n' RG000909-A..H6..10_1.jpg
The files could be copied with rsync with (list 1 as an example):
rsync -avz RG000909-A..H1..5_1.jpg dest/
All file names could be generated with (in bash):
printf '%s/n' RG000909-A..H1..10_1.jpg
The list 1 will be created with
printf '%s/n' RG000909-A..H1..5_1.jpg
And list 2 will be created with:
printf '%s/n' RG000909-A..H6..10_1.jpg
The files could be copied with rsync with (list 1 as an example):
rsync -avz RG000909-A..H1..5_1.jpg dest/
answered Jan 5 at 7:01
Isaac
6,8011834
6,8011834
add a comment |Â
add a comment |Â
up vote
0
down vote
I have done by using combination awk,sed and cp command.Tested it worked fine
Below are commands for list1 and list2 copying into destination directory
Destination directory and source directory You need to specify in the command
For list1
ls -ltr sourcedirectory_path |sed -n '/RG000909-[A-H][1-5]1_/p' | awk 'print "cp -rvfp" " " $1 " " "/Destination_directory/"' | sh
For list 2
ls -ltr sourcedirectory_path |sed -n '/RG000909-[A-H][1-5]_/!p' | awk 'print "cp -rvfp" " " $1 " " "/Destination_directory/"' | sh
add a comment |Â
up vote
0
down vote
I have done by using combination awk,sed and cp command.Tested it worked fine
Below are commands for list1 and list2 copying into destination directory
Destination directory and source directory You need to specify in the command
For list1
ls -ltr sourcedirectory_path |sed -n '/RG000909-[A-H][1-5]1_/p' | awk 'print "cp -rvfp" " " $1 " " "/Destination_directory/"' | sh
For list 2
ls -ltr sourcedirectory_path |sed -n '/RG000909-[A-H][1-5]_/!p' | awk 'print "cp -rvfp" " " $1 " " "/Destination_directory/"' | sh
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I have done by using combination awk,sed and cp command.Tested it worked fine
Below are commands for list1 and list2 copying into destination directory
Destination directory and source directory You need to specify in the command
For list1
ls -ltr sourcedirectory_path |sed -n '/RG000909-[A-H][1-5]1_/p' | awk 'print "cp -rvfp" " " $1 " " "/Destination_directory/"' | sh
For list 2
ls -ltr sourcedirectory_path |sed -n '/RG000909-[A-H][1-5]_/!p' | awk 'print "cp -rvfp" " " $1 " " "/Destination_directory/"' | sh
I have done by using combination awk,sed and cp command.Tested it worked fine
Below are commands for list1 and list2 copying into destination directory
Destination directory and source directory You need to specify in the command
For list1
ls -ltr sourcedirectory_path |sed -n '/RG000909-[A-H][1-5]1_/p' | awk 'print "cp -rvfp" " " $1 " " "/Destination_directory/"' | sh
For list 2
ls -ltr sourcedirectory_path |sed -n '/RG000909-[A-H][1-5]_/!p' | awk 'print "cp -rvfp" " " $1 " " "/Destination_directory/"' | sh
answered Jan 5 at 16:59
Praveen Kumar BS
1,010128
1,010128
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f414927%2fselectively-batch-copy-files%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password