在目标系统上(将在其中提取文件):
cd /target/dir && ssh user@source_server "cat /path/to/your/file.tar" | tar -xvv
Run Code Online (Sandbox Code Playgroud)
或者
从源服务器(tar 文件所在的位置):
ssh user@target_system "cd /target/dir && tar -xvv" < /path/to/your/file.tar
Run Code Online (Sandbox Code Playgroud)
下面有一些替代方案(在目标系统上),只是为了展示您可能会感兴趣的更高级的方式。
scp 和 bash 进程替换(如果可用):
scp user@source_server:/path/to/your/file.tar >(cd /target/dir && tar -x)
Run Code Online (Sandbox Code Playgroud)
scp和/proc/self(如果有):
cd /target/dir && scp user@source_server:/path/to/your/file.tar /proc/self/fd/1 | tar -x
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8913 次 |
| 最近记录: |