Transferring files

This page explains how to transfer files between your device and supercomputing system using sftp command.
It is a part of OpenSSH, so if you have read the previous page, you are not required any additional setup.
If you use WinSCP, please see How to transfer files using WinSCP.
If you use FileZilla, please see How to transfer files using FileZilla.
If you use Cyberduck, please see How to transfer files using Cyberduck.

Let's use sftp and connect to super.sc.imr.tohoku.ac.jp.
Open your terminal software (“cmd.exe” on Windows) and run sftp command as follows.

$ sftp super.sc.imr.tohoku.ac.jp
Enter passphrase for key ‘/home/username/.ssh/keys/id_rsa’:
password:
Connected to super.sc.imr.tohoku.ac.jp.\\
sftp> 


If not specified, your home directory on supercomputing system is set as current remote directory.

The basic usage of sftp is like below.

command description
ls {directory_name} shows the contents of remote directory named {directory_name}.
cd {directory_name} changes current remote directory to {directory_name}.
lls {directory_name} shows the contents of local directory named {directory_name}.
lcd {directory_name} changes current local directory to {directory_name}.
put {file_name} transfers local file named {file_name} to current remote directory.
put -r {directory_name} transfers local directory named {directory_name} on current remote directory.
get {file_name} transfers remote file named {file_name} to current local directory.
get -r {directory_name} transfers remote directory named {directory_name} on current local directory.
help shows usage of sftp command.
exit ends the connection.

attention!

If you use put or get command, file or directory which has the same name will be overwritten if there exists.


Here are some examples.

  • transfer a file named “test.txt” from local to remote
sftp> put test.txt
Uploading test.txt to /home/username/test.txt
test.txt                                        100%   16     0.8KB/s   00:00    
sftp> 


  • transfer a directory named “test” from remote to local
sftp> get -r test
Fetching /home/username/test/ to test
Retrieving /home/username/test
/home/username/test/test1.txt                    100% 1855    39.0KB/s   00:00    
/home/username/test/test2.txt                     100%  354     6.3KB/s   00:00    
sftp> 


In the next page, we finally explain how to run a job on supercomputing system.

  • getting_started/transfer_file.txt
  • Last modified: 2023/04/11 05:24
  • (external edit)