linux - 如何从服务器 SCP 选定的文件

标签 linux command-line command

我有一个简单的问题。如何从服务器中的文件夹下载(例如仅下载 json 文件)。

以下代码是我使用的,它会下载所有内容。

scp -r name:server:folder_name .

我想添加一些过滤,以便仅下载选定的文件,例如文件以 .json.wav 结尾

最佳答案

使用通配符

scp name:server:~/{*.json,*.wav} .

Commands can use wildcards to perform actions on more than one file at a time, or to find part of a phrase in a text file.

Source: TLDP

关于linux - 如何从服务器 SCP 选定的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57041582/

相关文章:

linux - 使用 Shell 运行多个子目录中的可执行程序文件

php - 使用 PHP 的阿拉伯语 Gammu SMS 无法发送

Linux CLI 查找没有子路径的 dir 路径 - 结果只有父路径

c# - 在 C# 中运行时 COPY 命令找不到指定的路径

java - 向控制台应用程序发送命令?

windows - 使用命令提示符调用子目录中的批处理文件

c - 将两个程序通过管道连接在一起 C Linux

php - 无法显示 Laravel 欢迎页面

python - 从命令行(终端)启动 Pycharm

c# - 执行命令 C# 不工作