All about File manipulation

Compression and Encoding

Compression is the shrinking of a file so it takes up less room.
Encoding is taking a binary file and changing it into a text file so it can be mailed.
Both also allow you to group multiple files into one file or archive.

Filetypes are indicated by the extension on a file. Here is a list of ways to create and decode the various type you may see.

file extension	     decode		   encode
--------------	     ------		   ------
file.Z	uncompress file.Z	compress file
file.gz	gzip -d file.gz		gzip file
file.tar	tar -xvf file.tar	tar -cvf file.tar file_names
file.uu	uudecode file.uu	uuencode file rfile > file.uu

So how do I mail files?

Tar archives are usually used for sending multiple files, because directories can be included, and all directory structures will remain intact when untarred.

Tar does not however, compress the files, so a tar file should be compressed, creating 'file.tar.Z' , however this is still a binary file.

UUEncode will change a binary file into a text file appropriate for mailing. Note that the rfile argument to uuencode is the remote file name which the archive will take on when uudecoded. The remote file name should always keep the same extensions, e.g.
'uuencode file_name.tar.Z remote_name.tar.Z > file.uu'
Any text file (such as a uunecoded file) can be mailed with the command:
'elm person@e-mail.address < file.uu'

Or we can combine it all into one giant command using redirection:
'tar -cvf - my_file | compress | uuencode remote.tar.Z | elm person@address'

WHEW!