- LinuxA:192.168.81.130
```
[root@localhost test]# ls
hello.txt
```
- LinuxB:192.168.81.131
```
[root@localhost ~]# ls
anaconda-ks.cfg
```
- LinuxA:192.168.81.130
```
[root@localhost test]# tar -cvf - hello.txt | ssh 192.168.81.131 "cd /home/ ; tar xvf -"
hello.txt
root@192.168.81.131's password:
hello.txt
```
- LinuxB:192.168.81.131
```
[root@localhost ~]# ls
anaconda-ks.cfg hello.txt
```
> 將要拷貝的目錄或文件進行打包,-代表標準輸出,然后再ssh傳輸?shù)侥繕酥鳈C,運行相應的命令,tar xvf -將前面的標準輸出內(nèi)容作為解包對象