UC San Diego SearchMenu

Transferring Files

Transferring computer files from one place to another is a rather broad topic. There are many methods available, some of which are exclusive of each other, and some of which may apply to more than one situation. Two important terms to know:

Download

The action of bringing a file from a remote location to your current location. For example, if you are using your home computer, bringing a file from your Unix account to your PC is called "downloading" the file. Working with two Unix accounts, downloading a file from another account means bringing the file to the account you are currently working in.

Upload

Upload is the opposite of download. It is the action of sending a file to a remote location.


What Files are Available Where?

Transferring files between two computers consists primarily of recognizing that there exists some service that both computers can use.

Every student has many places that files can be stored. Knowing what files are stored where can help you make conclusions about which tools to use, when.

  • Your Home Computer
    • This is the tricky part. We don't know what is installed on your home computer, so we can't tell you exactly what to do.
    • The good news is that you can easily install a new tool that will solve your file transfer needs. The names of some common programs for transferring programs are listed in parenthesis next to the service they provide. You can download these and install them on your home computer, and use them to transfer your files. Programs for Macs are colored blue, and programs for Windows are colored red.
  • CIFS Storage
    • Also Known As:
      • Windows XP 'My Documents' folder
      • Windows XP Desktop
      • Mac OS X Home Directory
    • These files are located on the Active Directory storage space, and can only be accessed by logging in directly to the Windows XP or Mac OS X computers.
    • Note also that the Mac OS X Home Directory is located inside the Windows XP 'My Documents' folder.
  • UNIX Home Directory for personal or class account
    • This is space on your mail server, for saving messages, files, and creating a web page.
    • Also Known As:
      • 'Home Directory' folders in Class Resources folder, under Windows XP
    • Can be accessed using:
      • SFTP, FTP (FetchWS-FTP, CuteFTP)
      • Class Resources folder on ACMS Windows XP and Mac OS X computers
      • ACS-Webmail stores its messages here
      • Samba (Windows/Mac OS X File Sharing)
      • cphome (an ACMS tool for moving your home directory between two ACMS computers)
      • SSH (PuTTYMacSSH, any UNIX terminal)
      • SCP (A Unix command line utility)
  • UNIX OCE class allocation
    • This is just another place on your mail server for storing files that you don't expect to need after your class ends.
    • Can be accessed using:
      • SFTP, FTP (FetchWS-FTPCuteFTP)
      • SCP (A Unix command line utility)
      • SSH (PuTTYMacSSH, any UNIX terminal)

Transferring between two Unix accounts

UNIX <--> UNIX

cphome -- Moving your entire home directory

There are times when one of your accounts may close, but another is opened for you. This is the case at the end of the quarter for course-specific accounts, or if you change your major and lose eligibility for an OCE account. cphome automates the process of moving your files from an old unix account to a new one.

See the help article for cphome for more information.

SFTP -- Secure File Transfer Protocol

When you know the machine names (eg, ieng9, sdcc13, etc.), the login names, and the passwords for the two accounts you wish to transfer files between, SFTP is the way to go. You start SFTP on one account, "connect" to your other account, and then can either upload ("put", in SFTP terminology) or download ("get") files. SFTP can also transfer multiple files at once, but CANNOT recursively copy an entire directory hierarchy in one fell swoop (i.e., it cannot copy an entire directory and all the subdirectories below it).

See the help article for sftp and "man sftp" for further details.

SCP -- Secure Remote Copy

SCP will copy a single file or directory with all its files and sub directories securely from one computer to another. If you need to copy many files, use SFTP, since SCP requires some advanced setup to avoid repeatedly typing in your password for each file. SCP is invoked directly from the command line and words very similarly to the regular "cp" command. SCP can also copy directory trees recursively.

See the help article for SCP and "man scp" for further details.

Mail -- using email programs to transfer files

You can use a unix mail program to attach a file to an email and send it to another account. Attaching a file and emailing it in this manner is especially useful if you do not know the passwords for both accounts (e.g., mailing a file to a friend or colleague). You can send both text files and binary files through a program such as Pine with no trouble.

The file you wish to send should be located somewhere in the account from which you're sending the email. Start Pine, and then compose a new message by pressing 'C'. Then type CTRL+J, and Pine will ask you for the name of the file you wish to attach. Type its name, or type CTRL+T, which will take you to a list of files in your home directory. After you've entered/selected the correct file name, and composed an accompanying email, send the message with the usual CTRL+X command, and the file will be sent along with the mail.

Note: Make certain that the recipient of the file can view whatever you are sending. Many files cannot be opened except by the same program that created them. Don't assume that the person will have the correct viewer unless it's a general file type, such as a document (.doc).

Downloading files to your home computer

HOME <-- UNIX

FTP (File Transfer Protocol) Programs

In order to transfer files on your home computer, you will need an SFTP or FTP program to handle file transfers. You can download and install such a program on a computer with internet access. There are many different programs available for the various computer operating systems. A recommended FTP program for Windows is WS_FTP (which supports Secure FTP transfers as well). For the Macintosh, Fetch works well. Both of these programs can be obtained for free from World Wide Web sites such as http://www.download.com.

Uploading files from your home computer

HOME --> UNIX

The same software that can handle downloading files to your home computer can also handle uploading files from your home computer. See the section above for information about acquiring SFTP or FTP software.


Transferring files to/from an ACMS Windows XP computer

UNIX <--> Windows XP

Windows XP computers in the ACMS labs are capable of connecting directly to your UNIX disk space. In fact, your UNIX disk space may be connected automatically. To use your Unix disk space:

  1. Double click on the "Class Resources" icon on your desktop
  2. Look for the icon that represents the unix space you want to connect to. For example, If you would like to put files in your Internet-sharable public_html directory, which is under your home directory, look for the icon whose name ends in "home directory on sdcc17", where sdcc17 should be replaced with the server where your account resides (e.g. your mail server).
  3. Double click on that icon. You may need to enter a password. If you do, be sure to check which username whose password it wants. This will be listed in the "Username" box of the connection window.
  4. The connected file space will then open in a new window, which works just like a floppy disk.

Special note for UNIX <--> PC file transfer

UNIX <--> PC

When text (ASCII) files are transferred files between a UNIX system and the PC via a BINARY transfer protocol which leaves the files completely unadulterated, frequently the results are unsatisfactory because the receiving system may complain about strange characters in the foreign- formatted file. BSD Unix users have two programs, dos2unix and unix2dos, which reformatted the plain text data from one machine into a version which can be easily read and manipulated on the other. The default mode of FTP is to transfer ASCII data, automatically correcting for the end of line differences at each end of the trasnfer. This is the suggested way to transfer ASCII (text) data.

Basic usage for the programs is as follows

   dos2unix file file
        unix2dos file file
       

On sdcc13, or sdcc17 the programs are called dos2bsd and bsd2dos, respectively.