Note that the commands shown below are typed in with no Enter in the middle even if shown continuing on a second line because the browser window isn't wide enough.
File transfer can use the scp command in a Terminal Window on your Mac. This software comes with OS X. You need to have a second terminal window open, in addition to the terminal window accessing the remote VCL Linux system, as was the case in the previous exercises. This one is running on your Mac. (It's started from Applications/Utilities.) You can transfer a file in either direction using the scp command, using your local Terminal window, giving the "from" file first and the "to" second. So to transfer a file to the remote computer from your local home directory (indicated by the ~ symbol)
H:~ Henry$ scp file-name myid@152.46.18.165:.
where 152.46.18.165 is the IP address of your Glide image reservation
and "file-name" is the name of your file on your local computer to be
copied to the remote computer. The "." after the ":" says
to keep the file-name the same. You will then receive a password
request from the remote computer - use the same password you used to
login. Use your window to the remote computer to see that the file was
received.Similarly the command
H:~ Henry$ scp myid@152.46.18.165:file-name .
transfers the remote file back into your local directory. Don't forget
the space after the file name, and then the following "." says it goes
into the directory in which you are working with the same name. As
before, you will get a password request.
|
To use WinSCP when you are have the Glide command window open via PuTTY, you need to start WinSCP. Use the File Protocol drop down menu to choose SCP, and then login. You'll then have a window showing both your local and remote directories. You can change directories by clicking on the line showing the current directory or double clicking the (sub)directory shown. Then you just click and drag files from one computer to the other. But there is a small problem. Windows and Linux use a slightly different way to designate ending a line and starting a new line in a text file ("text" includes numerical data). So if you move a data file from Windows to the remote Linux computer, you'll need to convert the file in the remote computer to use the Linux standard. That's very easy using the dos2unix command.*
[hes@vm18-165 ~]$ dos2unix file-name
dos2unix: converting file file-name to Unix format ...Now you're ready to use the data file on the remote Linux computer.
To move text files from the remote Linux computer back to your local
Windows computer.
[hes@vm18-165 ~]$ unix2dos file-name
unix2dos: converting file file-name to DOS format ...and then use WinSCP as above to click/drag the file to your Local computer. *If you're curious about the use of "unix" vs "Linux" - "unix" was the predecessor of Linux, and the name of this command wasn't changed. Also the original Microsoft Operating System was called "DOS" not Windows. |
For a lot more about transfering files including larger scale techniques (see Globus on that page for really large amounts of data.) But for most learning by trying, probably including class assignments, the scp transfer method described above should be adequate.