Download file from server using SSH
By:Roy.LiuLast updated:2019-08-17
Normally, you use Secure copy or SCP to download a file from another server via SSH connection. For example,
scp username@remotehost:remoteFileToDownload localFolderNameToSaveTheFile
1. SCP Examples
1.1 Download File From Server
Example to download a log file (hc.audit.log) from server (198.58.x.x), into your current local folder.
scp mkyong@198.58.x.x:/var/log/tomcat7/hc.audit.log .
1.2 Upload File To Server
Example to upload a hc.war file to server (198.58.x.x) ~/uploads folder.
scp hc.war mkyong@198.58.x.x:/uploads
Note
For detail example, please visit this SCP command examples
For detail example, please visit this SCP command examples
Done.
From:一号门
Previous:Log4j hello world example
COMMENTS