Bash:scp 目录中的所有文件,但不包括子目录
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17601230/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Bash: scp all files in a directory, but not the subdirectory
提问by Cokes
I would like to copy all files from a remote destination in a particular directory writegrid, but not the subdirectories, e.g. the files in writegrid/output_files.
我想从远程目标复制特定目录中的所有文件writegrid,而不是子目录,例如writegrid/output_files.
This
这个
scp -r [email protected]:~/writegrid/* ./
will copy the files in the writegrid/output_filesover as well.
也将复制文件writegrid/output_files。
Thank you.
谢谢你。
回答by cabad
Don't use the -rflag. It tells scpto copy recursively.
不要使用-r国旗。它告诉scp递归复制。

