我正在尝试将非常大的文件从一个主机移动到另一个主机。文件名也太大,所以我必须使用xargs
。此外,还需要复制所有子目录
我在源主机当前目录中使用以下命令
find . -name "*" -type f -print0 | xargs -0 scp -r UserName@host:/path/to/destination
但是它低于错误
scp: /path/to/destination: not a regular file
答案 0 :(得分:3)
您需要使用{}将src文件名放在目标之前。这是新命令:
find . -name "*" -type f -print0 | xargs -0 -I {} scp -r {} UserName@host:/path/to/destination