背景
我已经彻底阅读了这个问题:复制一系列字段并尝试了大部分答案。
我将数据导出为一个,.json
然后将.json
文件拆分为较小的序列化文件,每个文件有 50k 行。
$ls
smaller_aaaa smaller_aaak smaller_aaau smaller_aabe smaller_aabo smaller_aaby smaller_aaci smaller_aacs smaller_aadc smaller_aadm
smaller_aaab smaller_aaal smaller_aaav smaller_aabf smaller_aabp smaller_aabz smaller_aacj smaller_aact smaller_aadd smaller_aadn
smaller_aaac smaller_aaam smaller_aaaw smaller_aabg smaller_aabq smaller_aaca smaller_aack smaller_aacu smaller_aade smaller_aado
smaller_aaad smaller_aaan smaller_aaax smaller_aabh smaller_aabr smaller_aacb smaller_aacl smaller_aacv smaller_aadf smaller_aadp
smaller_aaae smaller_aaao smaller_aaay smaller_aabi smaller_aabs smaller_aacc smaller_aacm smaller_aacw smaller_aadg smaller_aadq
smaller_aaaf smaller_aaap smaller_aaaz smaller_aabj smaller_aabt smaller_aacd smaller_aacn smaller_aacx smaller_aadh smaller_aadr
smaller_aaag smaller_aaaq smaller_aaba smaller_aabk smaller_aabu smaller_aace smaller_aaco smaller_aacy smaller_aadi smaller_aads
smaller_aaah smaller_aaar smaller_aabb smaller_aabl smaller_aabv smaller_aacf smaller_aacp smaller_aacz smaller_aadj smaller_aadt
smaller_aaai smaller_aaas smaller_aabc smaller_aabm smaller_aabw smaller_aacg smaller_aacq smaller_aada smaller_aadk
smaller_aaaj smaller_aaat smaller_aabd smaller_aabn smaller_aabx smaller_aach smaller_aacr smaller_aadb smaller_aadl
目标
我想将文件从 to 复制smaller_aaau
到smaller_aadd
当前目录中的新目录中。
我试过的:
这些的变化以及
cp smaller_aa{au..dd} ./GlobalBuckets
我还尝试使用 bash 脚本:
#!/bin/bash
for file in {au..dd};do cp smaller_aa$file ~/Downloads/SPLIT/GlobalBuckets;done;
bash script
两种方法的错误:
cp: cannot stat 'smaller_aa{au..dd}': No such file or directory
您可以使用列表理解在一行中完成所有操作,但是对于这种情况,我认为上面的代码使逻辑更加可见
以小增量进行,例如:
smaller_aaau
先复制smaller_aaaz
,再复制smaller_aada
到smaller_aadd
,然后smaller_aaba
到smaller_aacz
应该是这样的:
方括号通配仅支持整数范围 (
[107-203]
) 或字符范围 ([a-d]
,[A-Ca-c]
)。