fsu seal Florida State University
Home >> Self Help >> Unix Help >> Copying Files
 

Computer Science Systems Group
Copying Files

 

Location & Hours
Carothers Rm. 208, MC4530
M-F, 8am-5pm
Map

Contact
send emailhelp@cs.fsu.edu
phone number 850/644-4019
contact us at personnel

 

How to Copy Files Between Machines, and to/from Your Home Computer


The only method available to transfer files between machines is via sftp and scp. Sftp is a secure version of FTP (the File Transfer Protocol), all data sent over the network is encrypted, including your username and password. Sftp is available with the included SSH client available from ACNS User Services.

SFTP

You may sftp to any machine which you are allowed to logon.

1. To connect to shell.cs.fsu.edu

type sftp username@shell.cs.fsu.edu at the command line.

2. Enter your password when prompted.

You can follow the same steps to connect to a different machine, replacing shell with the appropriate machine name.

Many of the file manipulation commands are the same in sftp as they are in a normal unix shell. This includes rm, rmdir, ls, pwd and many others. (For a complete listing of commands type man sftp.) The main difference here, however, is that these commands execute on the remote directory. To execute these commands on your local directory, simply add an "l" (ell) in front of the command. For instance, to list the local working directory you would type lpwd as opposed to pwd.

There are some special commands you will need to know, most of which have to do with transfering files between your local and remote machine. They are as follows:

put local-path remote-path This places a file in your local machine onto your remote machine.

get remote-path local-path And this command "gets" a file on your remote machine and copies it to your local machine.


SCP - Available on Unix Machines

To copy files between Unix machines, or when you need to quickly transfer a directory structure, use scp. scp is used as follows:

scp -r localdirectory remoteusername@remotemachine:remotedirectory

For remotedirectory . is the users home directory. So to copy a directory from the user's $HOME on foo to xi type (when in the users HOME):

scp -r projectDirectory xi.cs.fsu.edu:
or
scp -r projectDirectory xi.cs.fsu.edu:.

or if you want to copy it to a different directory

scp -r projectDirectory xi.cs.fsu.edu:./projects/myproject

Note the above command will copy the file from projectDirectory and put them in $HOME/projects/myproject on xi

Additionally, note that reversing the parameters will copy the remote file to the local machine, and will overwrite the local files. If you are unfamiliar with the command I would recommend testing it with some sample directories first.

Also, if you don't want scp to transfer entire directory structures remove the -r option.

 

Quick Links

Other Information