It's often useful (and sometimes vital) to transfer files between UNH's CIS Unix systems and other computers, typically PCs or Macs. The files you transfer can contain just about anything: collections of mail messages (often called "folders"), data files, programs, pictures, etc. This document describes a number of possible methods for accomplishing such transfers. There is no one "best" solution for everyone; depending on your own situation, you might find some methods described here difficult or impossible for you to implement. Hopefully, however, at least one method will work for you.
Some things are beyond the scope of this document. We're pretty concrete about how our Unix systems work, but given the wide range of computer hardware and software that could be at the "other" end of the transfer, we're pretty vague about that. Specifically, details involved in getting the other computer to communicate over the network with UNH's CIS Unix systems, or precise descriptions of how to use the other computer's software are pretty much absent here.
In addition, we'll describe only file transfer. Details on how to "make sense" of a file on the computer to which it's been transferred is a different issue, and not covered here. Sometimes "making sense" is easy, sometimes difficult, sometimes impossible; it always depends on the type of file data and the sofware available on the target machine. Files in standard formats (text, PostScript, GIF, JPEG, etc.) are least likely to give trouble. Good luck.
We'll discuss the following five methods here:
Nomenclature: In the following, the "source system" is the machine files from which files are to be transferred; the "target system" is the machine to which the files are to be transferred. We'll assume one of our CIS Unix systems is one end of the transfer; we'll denote the other end as the "other" machine, irrespective of whether it's source or target.
General sensible warning: unless you're very sure of yourself, don't delete the transferred files from the source system until you're sure that they've been transferred successfully to the target.
You can "attach" files of any kind (including entire e-mail folders) on the source system to an outgoing message sent to your address on the target system. When the message is received by you on the target system, you use the e-mail software there to de-attach the file from the message, saving it on disk. Given the proper software, there's no easier method; practically everyone "does" e-mail, and most PC/Mac mail-handling programs have good methods for dealing with attachments sensibly. Here, we'll describe what to do on the Unix end for sending and receiving attachments via the most popular mail program, Pine. One possible pitfall: if you're sending very large (typically megabyte or larger) files, the target's mail system may impose limits on the size of mail messages accepted, or how much you can hold on disk.
Suppose you want to send all the files in your ~/mail directory (where Pine keeps your mail folders) to another address. If you have a lot of files, it's a little tedious to attach-and-send them one at a time.
One possible workaround is to use a Unix shell loop. Here's what to do: From the shell prompt, change to the directory:
% cd ~/mail
Then type the following shell command loop (on four separate lines as shown; don't type the % and ? prompts.)
% foreach file (*)
? echo "This is $file" | mutt -a $file -s $file you@somewhere.else.edu
? echo sent $file
? end
This uses the mutt mailer to send out each file as an attachment in a separate message. (Pine can't be used this way.) Substitute your own target address for you@somewhere.else.edu of course. This method is pretty easy to adapt to different situations as well.
You can use FTP client software on the other machine to connect to the one of the CIS Unix machines' FTP servers and transfer files from or to your Unix home directory.
There is a large number of possible choices for FTP client software at the other end; on PCs, the FTP client in the QVT package is very common; on Macintoshes, Dartmouth College's Fetch software may be available. Recent versions of the popular web browsers from Netscape and Microsoft also have FTP client capability built-in. Given the wide range of client software, it's impossible to give detailed how-to directions. (If you are a UNH ResNet user, the ResNet Survival Guide published by CIS contains instructions for Fetch and QVT.)
Whatever client software you use, you will certainly need to (somehow) specify that you want to connect to the host cisunix.unh.edu, and give your login name and password. And once your connection is successfully made, there should be some method to transfer files either way between machines. Consult your documentation or an experienced user if necessary. (Or do what I do: swear a lot and try things at random. Usually, eventually something works, or I decide it wasn't that vital.)
In my limited experience, recent versions of Netscape are easiest to use as FTP clients. Just open the URL
ftp://username@cisunix.unh.edu
with no trailing slash, and substituting your own Unix login name for username. You should be asked for your password; once you enter it correctly, your CIS Unix home directory contents should be displayed in the browser window. You may be able to drag-and-drop files between your desktop windows and the browser window, and that will cause the appropriate transfer to be made. Otherwise, a shift-click on a file in the browser window will cause a transfer of the file from the Unix machine to your local host. Your client may offer you a choice between "Text" and "Binary" mode for the file transfer. Do the sensible thing: if you are transferring human-readable data files (mail, program source code, PostScript, etc.) use Text; if you're transferring non-text information (pictures, sounds, executable machine code, etc.) use Binary.
The Samba and Netatalk packages have been installed on a subset of CIS Unix machines; this allows convenient access to your CIS Unix home directory and files from network-connected PCs and Macs (even over PPP connections). Your Unix home directory can appear on your computer's desktop as a normal folder, whether you are at home, or in your dorm or office; you can use your usual point-and-click methods to access and manipulate your Unix files. Obviously this can be used for more than just file transfer, but file transfer between machines is just the normal drag-and-drop.
A section of the CIS Unix User's Guide goes into more detail on this topic at http://pubpages.unh.edu/notes/cisug/nonlogin.html#nonlogin-files
Note that access to your Unix home directory is automatic when you log into the PCs or Macs in the Student Access Computing Clusters here on campus. This should make it easy to (for example) copy your CIS Unix files to and from a floppy; you can then copy the files off the floppy to a more permanent home at your convenience.
You can also transfer files between your directory and a floppy disk on any of the 16 PCs running the Linux operating system in Kingsbury 317. You can also read files off standard CDs. Simply log in with your CIS Unix login name and password; your CIS Unix home directory is available when you log in. You can use normal Unix commands to copy files to/from removeable media. A section of the CIS Unix User's Guide goes into more detail on this topic at http://pubpages.unh.edu/notes/cisug/linux.html#linux-floppies
This one is kind of a last resort.
If you have a telecommunications package on the other computer that understands the Kermit file transfer protocol, then you can use the kermit program on the CIS Unix machines to transfer files back and forth. This tends to be slower and less convenient than any other method. On the other hand, it's your best (and pretty much only) choice when the other machine has no network connectivity, only a modem or direct serial connection.
You must first establish a login session on the CIS Unix systems; documentation on this is on the web at http://pubpages.unh.edu/notes/cisug/login.html. To send a text file from the Unix system to your computer, give the Unix shell command
% kermit -s file.dat
(Substituting the actual filename for file.dat.) If it's a non-text file, add the -i option:
% kermit -i -s file.dat
In either case, instruct your telecommunications program to receive a file via the Kermit protocol; this is often a menu choice.
To receive a text file on the Unix system from your computer, give the Unix command
% kermit -r
Similarly to above, if the file is non-text, add the -i option to the command. Then instruct your computer to send a file via Kermit protocol; this (again) will often be a menu choice.
Last modified: 2005-08-05 10:06 EDT
Paul A. Sand, pas@unh.edu