Remote Systems
Transfer Files
Learning Objectives
- Learn to transfer files from/to remote systems using
scp
Transfer a single file
$ scp notes.text spruce.hpc.wvu.edu:transfered.txtnotes.txt 100% 86 0.1KB/s 00:00
Transfer a directory
$ scp -r molecules spruce.hpc.wvu.edu:.cubane.pdb 100% 1158 1.1KB/s 00:00
ethane.pdb 100% 622 0.6KB/s 00:00
methane.pdb 100% 422 0.4KB/s 00:00
octane.pdb 100% 1828 1.8KB/s 00:00
pentane.pdb 100% 1226 1.2KB/s 00:00
propane.pdb 100% 825 0.8KB/s 00:00
A better way might be to copy the entire zip file
$ scp shell-novice.zip spruce.hpc.wvu.edu:We can check that the files are on the remote system
$ ssh spruce.hpc.wvu.edu lsmolecules
shell-novice-data.zip
special.txt
Reverse the order of hostname and filename to download the file from the remote system.
$ scp mountaineer.hpc.wvu.edu:special.txt download.txt
$ lsdownload.txt
======= > * Retrieve/put files from/to remote systems using sftp > * Retrieve/put files from/to remote systems using scp
Connect using sftp
$ sftp spruce.hpc.wvu.edulist remote directory
sftp> lslist local directory
sftp> llschange remote directory
sftp> cdchange local directory
sftp> lcddownload file
sftp> getput file
sftp> putUse the -R flag for directories
sftp> put -Rsftp has a list of other commands mirror filesystem commands
sftp> helpexit sftp
sftp> exitSimplifying transfers with SCP
transfer a single file
$ scp localfile spruce.hpc.wvu.edu:remotefileretrieve a file
$ scp spruce.hpc.wvu.edu:remotefile localfileUse the -R flag for directories
$ scp -r spruce.hpc.wvu.edu:remotedir localdir