gpt4 book ai didi

sftp - scp 或 sftp 使用单个命令复制多个文件

转载 作者:行者123 更新时间:2023-12-03 04:01:58 32 4
gpt4 key购买 nike

我想将文件从远程服务器复制到不同目录中。例如,我想一次运行这4个命令。

scp remote:A/1.txt local:A/1.txt
scp remote:A/2.txt local:A/2.txt
scp remote:B/1.txt local:B/1.txt
scp remote:C/1.txt local:C/1.txt

最简单的方法是什么?

最佳答案

将多个文件从远程复制到本地:

$ scp your_username@remote.edu:/some/remote/directory/\{a,b,c\} ./

从本地复制多个文件到远程:

$ scp foo.txt bar.txt your_username@remotehost.edu:~
$ scp {foo,bar}.txt your_username@remotehost.edu:~
$ scp *.txt your_username@remotehost.edu:~

从远程复制多个文件到远程:

$ scp your_username@remote1.edu:/some/remote/directory/foobar.txt \
your_username@remote2.edu:/some/remote/directory/

来源:http://www.hypexr.org/linux_scp_help.php

关于sftp - scp 或 sftp 使用单个命令复制多个文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16886179/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com