
我想遠端複製一個目錄(實際上是多個目錄,但這是一個簡單的例子),但我希望它不會複製在那裡找到的任何 .dat 檔案。
我目前正在使用:
scp -r remotemachine:/directory .
但我的 .dat 檔案很大,所以我寧願不將它們包含在副本中。
謝謝。
答案1
不幸的是 scp 沒有任何過濾檔案的選項。你最好使用 rsync:
rsync -rP --exclude '*.dat' user@server:/destination
答案2
嘗試mc
使用它的 shell 連結。[!.dat]*
複製時它應該遵循(或類似)過濾器。
答案3
嘗試這個:
scp -r [!.dat]* remotemachine:/directory
並讓我們知道。