Report issue Add example

base64

Base64 encode/decode files or standard input/output.

Description

base64 encodes or decodes FILE, or standard input, to standard output.

Syntax

base64 [OPTION]... [FILE]

Options

-d, --decode         # Decode data
-i, --ignore-garbage # When decoding, ignore non-alphabetic characters
-w, --wrap=COLS      # Wrap encoded lines after COLS character (default 76). Use 0 to disable line wrapping

--help               # Display this help and exit
--version            # Output version information and exit

Examples

Encode a string:

printf foo | base64

Encode a file:

base64 file

Decode a string:

printf Zm9v | base64 -d

Decode a file:

base64 -d file