在E-mail和MIME问世之前,想通过E-mail来传递binary文件还要费一番功夫,必须先用uuencode将二进制文件编码成一种特殊的ASCII文件,收信方得到后,可用uudecode来还原.
uuencode mybin sendbinname>myfile.uu
uudecode myfile.uu将得到senbinname (它的内容和mybin是一样的)
以前在书上看到uuencode和uudecode两个命令,但是现在大多数发行版好像都没这两个了(我在debian和ubuntu是没找到),当时还纳闷,网上也没down到源码.今天想看下basename的man,偶然碰到base64,看介绍和功能和uuencode,uudecode差不多.
BASE64(1) User Commands BASE64(1)
NAME
base64 - base64 encode/decode data and print to standard output
SYNOPSIS
base64 [OPTION] [FILE]
DESCRIPTION
Base64 encode or decode FILE, or standard input, to standard output.
-w, --wrap=COLS
Wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping.
-d, --decode
Decode data.
-i, --ignore-garbage
When decoding, ignore non-alphabet characters.
--help Display this help and exit.
--version
Output version information and exit.
With no FILE, or when FILE is -, read standard input.
The data are encoded as described for the base64 alphabet in RFC 3548. When decoding, the input may contain new‐
lines in addition to the bytes of the formal base64 alphabet. Use --ignore-garbage to attempt to recover from any
other non-alphabet bytes in the encoded stream.
uuencode mybin sendbinname>myfile.uu
uudecode myfile.uu将得到senbinname (它的内容和mybin是一样的)
以前在书上看到uuencode和uudecode两个命令,但是现在大多数发行版好像都没这两个了(我在debian和ubuntu是没找到),当时还纳闷,网上也没down到源码.今天想看下basename的man,偶然碰到base64,看介绍和功能和uuencode,uudecode差不多.
BASE64(1) User Commands BASE64(1)
NAME
base64 - base64 encode/decode data and print to standard output
SYNOPSIS
base64 [OPTION] [FILE]
DESCRIPTION
Base64 encode or decode FILE, or standard input, to standard output.
-w, --wrap=COLS
Wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping.
-d, --decode
Decode data.
-i, --ignore-garbage
When decoding, ignore non-alphabet characters.
--help Display this help and exit.
--version
Output version information and exit.
With no FILE, or when FILE is -, read standard input.
The data are encoded as described for the base64 alphabet in RFC 3548. When decoding, the input may contain new‐
lines in addition to the bytes of the formal base64 alphabet. Use --ignore-garbage to attempt to recover from any
other non-alphabet bytes in the encoded stream.