Such files cannot be directly included into an e-mail message. (Many mail programs will discard non-printing characters or convert them into other characters. Indeed many mail programs will do bad things to a text line which starts with a period, and a period is certainly a printing character!)
The uuencode program converts any file into a file that contains only printing characters (and no line in the result begins with a period either). It is, of course, a reversible operation. The uudecode program undoes the conversion.
Note that uuencoding makes a file larger.
The result is about 35% larger than the original.
uuencode MyProject.tar.Z MyProject.tar.Z > MyProject.tar.Z.uuThe first argument to uuencode is the file we wish to encode. The second argument is the name to attach to the recovered file when the receiver executes the uudecode command. The name is usually the same as the original file.
The final product is a file named MyProject.tar.Z.uu -- the .uu suffix is commonly used to indicate a uuencoded file.
The sender can now send the compressed archive file using a command like this:
mail -s 'My project file' joe@saturn.utu.fi < MyProject.tar.Z.uuThe string after the -s flag is used as a Subject line in the e-mail message.
To retrieve the original file, the recipient executes:
uudecode messageThis will cause a new file named MyProject.tar.Z to appear in the current directory. Now the recipient can run uncompress and tar to extract all the constituent files from the archive file.
Please refer to the Unix man pages for usage information.