简体   繁体   English

如何将某些文件从远程复制到本地?

[英]How to copy certain files from remote to local?

I can copy all files with extension .ds from a subdirectory "folder" to my local using: 我可以使用以下命令将所有扩展名为.ds的文件从子目录“文件夹”复制到本地:

scp -r  name@host:/data/folder/*.ds /pathtodestination/

However, there are lots of subdirectories under data and I want to copy all/only files with .ds from all subdirectories under data to my local. 但是, data下有很多子目录,我想将所有/仅带有.ds的文件从data下的所有子目录复制到本地。

Is there a way to do this? 有没有办法做到这一点?

You may need to try this 您可能需要尝试一下

scp -r  name@host:/data/**/*.ds /pathtodestination/

OR 要么

find <start directory> -iname "<all my files type>" -exec cp {} <target_dir> \;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以将文件从本地 windows 目录复制到远程 linux 目录? - Is it possible to copy files from local windows directory to remote linux directory? 检查远程服务器中的目录,同时将文件从本地复制到远程服务器 unix - check directory in remote server while copy files from local to remote server unix 如何使用 scp 将文件夹从远程复制到本地? - How do I copy a folder from remote to local using scp? 如何将文件从远程服务器的docker容器复制到本地机器 - How to copy file from docker container of remote server to local machine 如何将文件从远程服务器复制到hdfs位置 - How to copy files from a remote server to hdfs location 使用 scp 将文件从本地文件夹复制到远程文件夹,脚本抛出“没有这样的文件或目录” - Copy files from a local to remote folder with scp and script throws “No such file or directory” SFTP 批处理文件从远程复制到本地 - SFTP batch file to copy from remote to local 是否可以在将来的某个预定义时间使用 scp 将文件从远程复制到本地? - Is it possible to use scp to copy files from remote to local at some predefined time in the future? 从远程服务器并行复制小文件 - copy small files in parallel from remote servers SFTP 使用本地脚本从远程删除文件 - SFTP remove files from remote with local script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM