# uuencode(5) - man - phpman

> **TLDR:** Encode binary files into ASCII for transport via mediums that only support simple ASCII encoding.
>
- Encode a file and print the result to `stdout`:
  `uuencode {{path/to/input_file}} {{output_file_name_after_decoding}}`
- Encode a file and write the result to a file:
  `uuencode -o {{path/to/output_file}} {{path/to/input_file}} {{output_file_name_after_decoding}}`
- Encode a file using Base64 instead of the default uuencode encoding and write the result to a file:
  `uuencode {{-m|--base64}} -o {{path/to/output_file}} {{path/to/input_file}} {{output_file_name_after_decoding}}`

*Source: tldr-pages*

---

[UUENCODE(5)](https://www.chedong.com/phpMan.php/man/UUENCODE/5/markdown)                              File Formats Manual                             [UUENCODE(5)](https://www.chedong.com/phpMan.php/man/UUENCODE/5/markdown)



## NAME
       uuencode - format of an encoded uuencode file

## DESCRIPTION
       Files output by [uuencode(1)](https://www.chedong.com/phpMan.php/man/uuencode/1/markdown) consist of a header line, followed by a number of body lines, and
       a trailer line.  The [uudecode(1)](https://www.chedong.com/phpMan.php/man/uudecode/1/markdown) command will ignore any lines preceding the header  or  fol‐
       lowing the trailer.  Lines preceding a header must not, of course, look like a header.

       The  header  line  is  distinguished  by having the first 5 characters be _begin_ followed by a
       space, or else a hyphen and either _base64_ or _encoded_ or both (also separated with a  hyphen).
       The  _base64_  option says the file has been encoded using base64.  The _encoded_ option says the
       output file _name_ has been base64 encoded.  It is never encoded with  traditional  uuencoding.
       This  is  a GNU extension.  These are followed by a mode (in octal), and a string which names
       the remote file.  The mode is separated from the _begin_ clause and the file name by  a  single
       space character.

### Traditional uuencoding
       The traditional _uuencoded_ file body consists of a number of lines, each at most 62 characters
       long (including the trailing newline). These consist of a character count letter, followed by
       the  encoded  characters,  followed  by  a newline.  The character count is a single printing
       character, and represents an integer, the number of bytes the rest of  the  line  represents.
       Such  integers  are always in the range from 0 to 63 and can be determined by subtracting the
       character space (octal 40) from the character.

       Groups of 3 bytes are stored in 4 characters, 6 bits per character.   All  are  offset  by  a
       space  to  make  the  characters  printing.   The last line may be shorter than the normal 45
       bytes.  If the size is not a multiple of 3, this fact can be determined by the value  of  the
       count  on the last line.  Extra garbage will be included to make the character count a multi‐
       ple of 4.  The body is terminated by a line with a count of zero.  This line consists of  one
       ASCII space.

       The trailer line consists of _end_ on a line by itself.

### base64 encoding
       _base64_  encoded  files  follow  the  specified format for the body, but also include a _begin-_
       _base64_ header and a trailer line of four _=_ characters.

## EXAMPLES
            begin-base64-encoded 644 VE9ETw==
       This introduces a base64 encoded file named, _TODO_ with that name encoded using base64  encod‐
       ing.

            begin-encoded 644 5$]$3P``
       This introduces an encoded file named, _TODO_ with that name encoded using uuencoding.  The en‐
       coding is a lot less friendly.  Please prefer base64 encoding.

## CONFORMING TO
       IEEE Std 1003.1, plus extensions

       The _-encoded_ suffix to the _begin_ header line is a GNU extension.  Recipients  must  have  the
       GNU _uudecode_ program to decode them.

## SEE ALSO
       [uuencode(1)](https://www.chedong.com/phpMan.php/man/uuencode/1/markdown), [uudecode(1)](https://www.chedong.com/phpMan.php/man/uudecode/1/markdown), [base64(1GNU)](https://www.chedong.com/phpMan.php/man/base64/1GNU/markdown)

## HISTORY
       The _uuencode_ file format appeared in BSD 4.0 .



                                                                                         [UUENCODE(5)](https://www.chedong.com/phpMan.php/man/UUENCODE/5/markdown)
