---
layout: page
category-page: intermediate
category-title: Intermediate commands
tags: base64 representation
author: Gianmarco De Vita
title: base64
previous-page: pages/cmd/interm/apropos.html
next-page: pages/cmd/interm/basename.html
---
Base64 is an encoding system that allows the translation of binary
data into ASCII text strings, basing upon 64 different ASCII characters.
Each Base64 digit represents exactly 6 bits of data so, for example,
six bytes (a total of 48 bits) can be represented by eight Base64 digits.
By writing the command base64
you can encode and decode Base64 data.
The command follows the structure:
base64 [flag] [-i input item] [-o output item]
-i
and -o
are fundamental
to define respectevely from which file take the stream and into which to store
the result. Naturally, the path and the name of the files must be specified.
base64 -i path/input.file -o path/output.file
-b
(which stands for break) flag followed by a
number, line breaks are added every specified "number" characters.
base64 -b number path/input.file path/output.fileBy leaving the number field empty, an unbroken stream will be generated.<
-D
flag (which stands for decode), you obtain as
output the input message decoded into binary data.
base64 -D [-i input item] [-o output item]
-h
(which stands for help) a short paragraph
in which are listed the flags with the respective paragraph will be displayed.
base64 -h