To login to the SFTP server, type in sftp username@server at the UNIX command prompt. Once logged in, you can change directories on the SFTP site similar to how you would change directories in UNIX: with the cd command. You can also change directories on you local account using the lcd command. To transfer files from one server to another, you need to first be in the correct local and SFTP directories from which you want the files transferred to/from.
To copy a file from the SFTP server to your local host, use the get command. For example, if you wanted to get the file ids.txt, you would type get ids.txt at the command prompt. Conversely, to transfer file to the SFTP site from your local host, use the put command. The SFTP also uses wildcards (*), so if for example, you wanted to transfer all .jpg files to the SFTP server, you would type in put *.jpeg at the command prompt. Below are a few other useful commands.
Sftp Command | Description |
---|---|
cd dir | Change directory on the ftp server to dir. |
lcd dir | Change directory on your machine to dir. |
ls | List files in the current directory on the ftp server. |
lls | List files in the current directory on your machine. |
pwd | Print the current directory on the ftp server. |
lpwd | Print the current directory on your machine. |
get file | Download the file from the ftp server to current directory. |
put file | Upload the file from your machine to the ftp server. |
exit | Exit from the sftp program. |
Also, remember it is always a good idea to check the checksums of files you have downloaded with those on the SFTP site to ensure you downloaded the files in their entirety.
No comments:
Post a Comment