在linux中将文件列表从一个位置复制到另一个位置

我正在尝试将驱动器上的部分文件列表复制到另一个驱动器上的某个位置.要复制的文件列表是我试图提供给bash脚本的文本文件以及一些cp和xargs命令但无济于事.下面是bash尝试.

#!/bin/bash

while read line
do
    find . -iname "$line" -exec cp '{}' /my/destination/drive \;
done < file_list.txt 

文本文件读作没有扩展名的文件名,如下所示

my-file001
my-file002
my-file003

我也尝试过以下尝试的xargs和pax,也无济于事.

cat file_list.txt | xargs cp -t /my/destination/drive

find . -type f -exec pax -rws'|.*/||' < file_list.txt /my/destination/drive/ '{}' \;

这个question接近但不完全.有什么建议?

解决方法:

这只是为你做的伎俩:

 cat file_list.txt | xargs -I {} cp {} /destination/dir/path

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...