Files can be transferred between various accounts on either the same or different host.
File Transfer Within the Same UNIX Host
For simple file transfers within the same UNIX host, you can use the
For info on using
cp for copying files within the same account, see the ITS documentation
at Directory Commands.
To copy files between two user's accounts, type:
The following example will take a copy of the file
assign1 from the account
comp101 and will put a copy of the file in the account ttrojan in the directory
cp ~comp101/assign1 ~ttrojan/classes/hwassign
Note: This will work only if you have write permissions to the other user's specified directory.
Between two UNIX Hosts at USC
For file transfers between two different hosts at USC, you can use the
However, you need to be able to login to both hosts without a password. You can do this by setting up a
.rhosts file in both accounts. The syntax for the rcp command is:
rcp aludra:~ee101/hw1sol mizar:~htroy/classes/sol1
The above example will take a copy of the file
hw1sol from the account ee101 on the host
aludra and put a copy of the file in the account htroy on the host mizar in the directory
File Transfer Between Machines
For file transfer between machines, you can use the
ftp between two UNIX hosts, you must have an account on both hosts.
You can also transfer files via e-mail. Most e-mail applications allow you to insert a file into your message. Some applications also allow you to send a file as a separate attachment. See ITS documentation on the supported e-mail applications at our Email Documentation for more information.
If you are including a binary (executable) file into an e-mail message, you will need to encode the file. You do not need to encode a binary file if you are sending it as an attachment. To encode a file, type:
uuencode <binary_filename> <label_name> >
Where <binary_filename> is the name of the binary file you wish to encode, <label_name> is the name of the file that will be created when the person receiving the encoded file decodes it (you can use the same name as the <binary_filename>), and <encoded_filename> is the name of the encoded file you are creating.
uuencode myprog yourprog > encodedprog
The above example will take the binary file
myprog, encode it and create
a new file called
encodedprog. When the receiver decodes
encodedprog, a file called
yourprog will be
created in their account.
To decode an encoded file, type: