直接上例子:scp MobileFaceNet_Pytorch-master.sh sx111@192.168.120.15:/home/sx111/file/
说明:上面这个指令是应该在本地端执行的
scp表示拷贝文件
MobileFaceNet_Pytorch-master.sh是本地端当前目录下的文件,如果需要拷贝的不是当前目录下的文件,可以用绝对路径抵达。
sx111是服务器上我自己的用户名
192.168.120.15是服务器地址
/home/sx111/file/表示文件会被拷贝到file文件夹里,这里注意file后面的/不要遗漏。
scp MobileFaceNet_Pytorch-master sx125@192.168.120.13:/home/sx125/file/
报错:MobileFaceNet_Pytorch-master: not a regular file
因为MobileFaceNet_Pytorch-master是一个文件夹而非文件,上传文件夹要在名前加-r,如下:
scp -r MobileFaceNet_Pytorch-master sx125@192.168.120.13:/home/sx125/file/