如何使用 ssh 命令在遠端電腦上解壓縮/解壓縮檔案?

如何使用 ssh 命令在遠端電腦上解壓縮/解壓縮檔案?

我在伺服器 A、B、C 上有一個壓縮檔。

該命令ssh -f ip "unzip path/file.zip"正在我運行命令的伺服器上搜尋路徑,而不是在指定的 IP 上搜尋。我究竟做錯了什麼?

答案1

嘗試這個:

ssh user@A "unzip path/file.zip"

如果它正常工作,則添加-f以將其置於後台:

ssh -f user@A "unzip path/file.zip"

ssh -f user@B "unzip path/file.zip"

ssh -f user@C "unzip path/file.zip"

相關內容