scp是基于SSH的文件传输工具,适用于不同服务器之间、服务器与本地、本地与服务器之间的文件传输。
scp /path/to/local/file username@remote_host:/path/to/remote/destination
scp username@remote_host:/path/to/remote/file /path/to/local/destination
scp -3 user1@remote1:/path/to/file user2@remote2:/path/to/destination
rsync是一个用于文件和目录同步的工具,它支持增量传输和带宽限制,非常适合大文件和目录的传输。
rsync -avz /path/to/local/file username@remote_host:/path/to/remote/destination
rsync -avz username@remote_host:/path/to/remote/file /path/to/local/destination
rsync -avz -e ssh user1@remote1:/path/to/file user2@remote2:/path/to/destination
sftp是SSH文件传输协议,适用于交互式文件传输。
sftp username@remote_host sftp> put /path/to/local/file /path/to/remote/destination
sftp username@remote_host sftp> get /path/to/remote/file /path/to/local/destination
FTP是文件传输协议,适用于非安全环境下的文件传输。
ftp remote_host ftp> login ftp> put /path/to/local/file /path/to/remote/destination
ftp remote_host ftp> login ftp> get /path/to/remote/file /path/to/local/destination