UUENCODE(5)
โจ UUENCODE(5) โจ
okay bestie, sit down, because today we're decoding the vibe of the uuencode file format โ the File Formats Manual entry for it, to be exact. No gatekeeping, let's go ๐
๐ธ NAME ๐ธ
uuencode โ the format of an encoded uuencode file. That's it, that's the name, she's simple and she's iconic.
๐ DESCRIPTION ๐
So like, files that come out of uuencode(1)? They're built like a little sandwich ๐ฅช โ a header line, then a bunch of body lines, then a trailer line. That's the whole structure. Obsessed, honestly.
And here's the chill part: uudecode(1) is so unbothered. It will straight up ignore any lines preceding the header or following the trailer. Extra stuff outside the sandwich? Not her problem. ๐
BUT. Lines that come before a header must not, of course, look like a header. Like, don't be sneaky. That's the one rule ๐จ
the header line, explained ๐ซถ
How do you even spot a header? The first 5 characters have to be begin followed by a space โ or else a hyphen and either base64 or encoded or both (also separated with a hyphen).
Let's break down what those words mean, no cap:
base64โ says the file has been encoded using base64.encodedโ says the output file name has been base64 encoded.
And listen: it is never encoded with traditional uuencoding. Never ever. This whole hyphen situation is a GNU extension, iykyk.
After all that comes a mode (in octal), and then a string which names the remote file. And the mode is separated from the begin clause and the file name by a single space character. One space. Not two. She's precise like that โจ
๐ Traditional uuencoding ๐
The traditional uuencoded file body is a bunch of lines, and each one is at most 62 characters long (including the trailing newline โ yes, the newline counts, she's included).
Each line goes: a character count letter, then the encoded characters, then a newline. That's the order, don't rearrange her.
That character count is a single printing character, and it represents an integer โ the number of bytes the rest of the line represents. These integers are always in the range from 0 to 63, and you figure them out by subtracting the character space (octal 40) from the character. Math but make it cute ๐งฎ
Now the actual encoding tea:
- Groups of 3 bytes are stored in 4 characters, 6 bits per character.
- All of them 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, you can figure that out from the value of the count on the last line.
- Extra garbage will be included to make the character count a multiple of 4. (yes, literally garbage, and we love her for it ๐)
- The body is terminated by a line with a count of zero.
- That line consists of one ASCII space. Just a little guy. A single space holding the whole thing together ๐ฅน
The trailer line consists of end on a line by itself. Periodt.
๐ฆ 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. Four of them. ==== ๐
๐ EXAMPLES ๐
begin-base64-encoded 644 VE9ETw==
This introduces a base64 encoded file named, TODO with that name encoded using base64 encoding. She's clean, she's readable, she ate ๐ฅ
begin-encoded 644 5$]$3P``
This introduces an encoded file named, TODO with that name encoded using uuencoding.
The encoding is a lot less friendly. Please prefer base64 encoding. Fr fr, take the advice ๐
๐ CONFORMING TO ๐
- IEEE Std 1003.1, plus extensions
And a little lore drop: the -encoded suffix to the begin header line is a GNU extension. Recipients must have the GNU uudecode program to decode them. No GNU uudecode, no decode. That's the deal ๐ซก
๐ SEE ALSO ๐
uuencode(1)uudecode(1)base64(1GNU)
๐ฐ๏ธ HISTORY ๐ฐ๏ธ
The uuencode file format appeared in BSD 4.0. Ancient. Elder icon behavior, honestly โญ
and that's the whole page bestie!! this was the UUENCODE(5) entry from the File Formats Manual, living right alongside all her sibling pages, and yes she's still rocking that same UUENCODE(5) footer energy like the legend she is. go forth and decode responsibly ๐โจ๐
๐ฆ where this page comes from
- alpine 3.22: sharutils-doc 4.15.2-r6 ยท GPL-3.0-or-later
- alpine 3.23: sharutils-doc 4.15.2-r6 ยท GPL-3.0-or-later
- alpine 3.24: sharutils-doc 4.15.2-r6 ยท GPL-3.0-or-later
- arch rolling: sharutils 4.15.2-6 ยท GPL-3.0-or-later
- centos-stream 10: sharutils 4.15.2-28.el10 ยท GPL-3.0-or-later AND (GPL-3.0-or-later AND BSD-4-Clause) AND (LGPL-3.0-or-later OR BSD-3-Clause) AND LGPL-2.0-or-later AND LGPL-3.0-or-later AND LicenseRef-Fedora-Public-Domain AND GFDL-1.3-or-later
- centos-stream 9: sharutils 4.15.2-21.el9 ยท GPLv3+ and (GPLv3+ and BSD) and (LGPLv3+ or BSD) and LGPLv2+ and Public Domain and GFDL
- debian bookworm: sharutils 1:4.15.2-9
- debian trixie: sharutils 1:4.15.2-12
- fedora 43: sharutils 4.15.2-30.fc43 ยท GPL-3.0-or-later AND (GPL-3.0-or-later AND BSD-4-Clause) AND (LGPL-3.0-or-later OR BSD-3-Clause) AND LGPL-2.0-or-later AND LGPL-3.0-or-later AND LicenseRef-Fedora-Public-Domain AND GFDL-1.3-or-later
- fedora 44: sharutils 4.15.2-31.fc44 ยท GPL-3.0-or-later AND (GPL-3.0-or-later AND BSD-4-Clause) AND (LGPL-3.0-or-later OR BSD-3-Clause) AND LGPL-2.0-or-later AND LGPL-3.0-or-later AND LicenseRef-Fedora-Public-Domain AND GFDL-1.3-or-later
- nixos 26.05: sharutils 4.15.2
- nixpkgs unstable: sharutils 4.15.2
- opensuse-leap 16.0: sharutils 4.15.2-160000.2.2 ยท GPL-3.0-or-later
- opensuse-leap 16.0: sharutils 4.15.2-160000.2.2 ยท GPL-3.0-or-later
- opensuse-leap 16.0: sharutils 4.15.2-160000.2.2 ยท GPL-3.0-or-later
- opensuse-leap 16.0: sharutils 4.15.2-160000.2.2 ยท GPL-3.0-or-later
- ubuntu jammy: sharutils 1:4.15.2-5build1
- ubuntu noble: sharutils 1:4.15.2-9
- ubuntu questing: sharutils 1:4.15.2-12
- ubuntu resolute: sharutils 1:4.15.2-13
- ubuntu stonking: sharutils 1:4.15.2-13
- Copyright (c) 1989-2015 The Regents of the University of California
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms