上传单个文件到远程服务器
命令格式
scp [/path/local_dir/filename] [[email protected]:/path/remote_dir]
上传本地的vimrc文件到远程服务器
15:10 [email protected] /home/luna $ scp /home/luna/scp/vimrc [email protected]:/usr/home/luna/.vimrc Password for [email protected]: vimrc 100% 8090 7.9KB/s 00:00
上传文件夹到远程服务器
命令格式
scp -r [/path/local_dir] [[email protected]:/path/remote_dir]
上传当前目录下的tools文件夹到远程服务器
15:35 [email protected] /home/luna/scp $ scp -r tools [email protected]:/usr/home/luna Password for [email protected]: test1.sh 100% 152 0.2KB/s 00:00 test3.sh 100% 165 0.2KB/s 00:00 test4.sh 100% 131 0.1KB/s 00:00 test2.sh 100% 120 0.1KB/s 00:00
从远程服务器下载单个文件
命令格式
scp [[email protected]:/path/remote_dir/filename] [/path/local_dir]
从远程服务器下载一个Python3源码压缩包
18:10 [email protected] /home/luna/scp $ scp [email protected]:/usr/home/luna/Python-3.6.2.tar.xz ~/scp/test Password for [email protected]: Python-3.6.2.tar.xz 100% 16MB 8.1MB/s 00:02
从远程服务器下载文件夹
命令格式
scp -r [[email protected]:/path/remote_dir/] [/path/local_dir]
下载远程服务器上的install文件夹
18:30 [email protected] /home/luna/scp $ scp -r [email protected]:/usr/home/luna/install ~/scp/test Password for [email protected]: portage-latest.tar.xz 100% 62MB 8.9MB/s 00:07 install-amd64-minimal-20170727.iso 100% 268MB 10.3MB/s 00:26
时间: 2024-10-16 10:48:15