Press "Enter" to skip to content

使用SSH命令行传输文件到远程服务器

上传本地文件到服务器

scp /localPath/filename username@hostPath:/serverPath/filename

上传目录到服务器

scp -r /localPath/localDir username@hostPath:/serverPath/remoteDir

从服务器上下载文件

scp username@hostPath:/serverPath/filename /localPath/filename

从服务器下载整个目录

scp -r username@hostPath:/serverPath/remoteDir /localPath/localDir
Leave a Reply

Your email address will not be published. Required fields are marked *