[英]Recursively copy files by file extension to remote sever
我想將所有文件*.txt
復制到遠程服務器。 我試過了:
find . -name '*.txt' -exec scp {} user@server:directory ";"
但每次找到文件時都會ask for the password
。
您是否有更好的想法? 非常感謝你。
也許您可以使用ls
嘗試我們的grep
:
scp `/bin/ls |grep '.txt'` user@destination:/path/to/copy/
它只會詢問一次密碼;-)
更新:對於遞歸復制,可以使用tree
(必須先安裝tree
)
scp `tree -if --noreport .|grep ".txt"` user@destination:/path/to/copy/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.