LinuxCommandLibrary

uudecode

Decode uuencoded files

TLDR

Decode a file that was encoded with uuencode and print the result to stdout

$ uudecode [path/to/encoded_file]
copy

Decode a file that was encoded with uuencode and write the result to a file
$ uudecode -o [path/to/decoded_file] [path/to/encoded_file]
copy

SYNOPSIS

uudecode [options] [file...]

PARAMETERS

-o file
    Specify the output file to write the decoded data. Overrides the filename specified in the input.

-p
    Decode and print to standard output.

[file...]
    The uuencoded file(s) to decode. If no file is specified, uudecode reads from standard input.

DESCRIPTION

The uudecode command decodes files that have been encoded using the uuencode command. Uuencoding is a method of converting binary data into ASCII characters, making it suitable for transmission over channels that might not support binary data (e.g., older email systems). Uudecode reads a uuencoded file (or standard input if no file is specified) and reconstructs the original binary file. The output file's name and permissions are usually embedded within the uuencoded data itself, extracted by uudecode from the encoded file's header. The command effectively reverses the encoding process performed by uuencode. Uudecode ignores any lines preceding the 'begin' line in the input file. It stops processing when it encounters the 'end' line. Uudecode is vital for handling legacy systems that transmit binary data using ASCII encoding.
The command decodes base64 too. Decoding of base64 data is also possible by automatically detecting the encoding format within the input file.

CAVEATS

If the output file already exists, uudecode will overwrite it without prompting. The correct permissions and name in the target can be ignored. Always verify output integrity especially when handling sensitive data.

DECODING BASE64

Uudecode can automatically detect base64-encoded data within the input file and decode it, even if the file isn't explicitly marked as uuencoded. This simplifies handling files with mixed encoding formats.
The autodetection includes: begin-base64 and end-base64 markers for base64, and begin and end for uuencoded.

HISTORY

The uuencode/uudecode utilities have been part of Unix systems for a very long time. They were developed to transmit binary files through email and other text-based channels that couldn't reliably handle binary data directly. Over time, newer encoding schemes like MIME and Base64 have become more prevalent, but uuencode/uudecode remain useful for compatibility with older systems and workflows.

SEE ALSO

Copied to clipboard