The sftp and scp commands
Overview
In the course of your computational biology lifetime, you may need to move files back and forth between UNIX systems that are secured by SSH. The sftp
and scp
commands are ideal for this task. For those of you using Linux or MacOS X computers, please follow along as we transfer a file from today's exercises to your local system using both commands.
SFTP
Open a new Terminal window and enter the following
sftp YOUR_USERNAME@lonestar.tacc.utexas.edu
and enter your password when promptedcd /corral-repl/utexas/BioITeam/tacc_ngs/
get bowtie-launcher.sh
quit
If all goes according to plan, you will see a file transfer go by quickly, and in your local home directory, the bowtie-launcher.sh file will appear. You can edit it and push it back up to Lonestar (though not to the BioITeam directory!)
Question: How would you upload this local file back to Lonestar using SFTP?
SCP
SFTP gives you interactive access to the remote and local file systems, but you may know exactly where yo want to copy from and exactly where it needs to go. This is where SCP shines! Here's the sequence of commands for doing the same thing we just did with SFTP but using SCP instead.
scp YOUR_USERNAME@lonestar.tacc.utexas.edu:/corral-repl/utexas/BioITeam/tacc_ngs/bowtie-launcher.sh .
Tough huh? To go the other way...
scp bowtie-launcher.sh YOUR_USERNAME@lonestar.tacc.utexas.edu:
Now, you're a command-line data transfer pro. Make sure to check out the manual pages for sftp and scp and research around a little on the web to learn even more about their usage.
Welcome to the University Wiki Service! Please use your IID (yourEID@eid.utexas.edu) when prompted for your email address during login or click here to enter your EID. If you are experiencing any issues loading content on pages, please try these steps to clear your browser cache.