APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

2003/11/25 uuencode, uudecode

© November 2003 Tony Lawrence

Convert a file to an ascii representation that can be safely transmitted through mail gateways, posted on newsgroups, etc.

Nowadays, attaching a file to an email or a newsgroup post is often "behind the scenes" - you don't get involved in the details. And while mail programs do still have to encode attachments, they are more apt to use base64 than uuencode.

Uuencode does have its uses though. You can create a mail message with an attached file simply by:

cat file | uuencode file | mail -s "here's your file" them@somewhere.com

Note that the resulting mail message is not the same as a message created with a MIME attachment, though many mail readers will treat it the same way and allow the recipient to save the file simply by clicking on it. See How can I send attachments from the command line?.

A uuencoded file will look something like this

begin 644 t1

If that file were called "t1.uu", you would recreate "t1" by

uudecode t1.uu

Uudecode handily ignores things that don't belong to it, so t1.uu could look like this and still decode:

Here's the file you need:
begin 644 t1

Just uudecode this.

You can't send multiple sets that way though; if you have multiple files, tar or cpio them and uuencode that.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> uuencode, uudecode

Inexpensive and informative Apple related e-books:

Take Control of Preview

Take Control of High Sierra

Take Control of Numbers

Take Control of OS X Server

Take Control of IOS 11

More Articles by © Tony Lawrence

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

Computers are useless. They can only give you answers. (Pablo Picasso)

Linux posts

Troubleshooting posts

This post tagged:




Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode