In Unix, how do I uuencode a binary file?
The uuencode command uses the syntax: uuencode original_filename final_filename > encoded_filename
original_filename with the name of your
binary file. Replace
final_filename with the
name that you want the file to have when it is eventually decoded
(usually the same as
encoded_filename with the name you want to give the
uuencoded version of the binary as it will appear in your directory.
For example, to convert a binary file named
into a uuencoded (text) file named
myfile.uue, you would
enter at the Unix prompt:
uuencode myfile.zip myfile.zip > myfile.uue
The original binary file
myfile.zip is unchanged, and the
myfile.uue is now located in your current
directory. The greater-than character (>) is used to redirect
output; it takes the output of the uuencode command and directs it
into the file
myfile.uue (rather than onto your screen).
The purpose of the
uuencode program is to translate a binary file that
contains unprintable (non-text) characters into a format that is
entirely readable. This prevents mail, news, and terminal programs
from misinterpreting non-text characters as special instructions. A
text file produced by
uuencode may thus be mailed as an ordinary mail
message and later uudecoded into its original binary form by the
recipient. The uuencoded file is usually larger than the original
binary file, because the unprintable characters in the binary file are
expanded into multiple readable characters.
At Indiana University, for personal or departmental Linux or Unix systems support, see At IU, how do I get support for Linux or Unix?
Last modified on August 22, 2008.