BASE64(1) General Commands Manual BASE64(1)

base64encode/decode base64 data to standard output

base64 [-d] [-w wrap] [file...]

base64 reads file, encodes or decodes in base64 and writes the results into standard output. If no file is given, base64 reads from the standard input.

Should be noted that the terminal-driver stdin buffering can have a maximum amount of characters per line (4096 on Linux, see tcsetattr(3)). So for copy-pasting large amounts of data you should either pipe it from a command like wl-paste(1) or xclip(1), or generate base64 data with a line length shorter than the terminal driver buffer, for example via:

base64 -w $(tput cols)

Decode input instead of encoding it.
wrap
Write at most wrap characters per line instead of the default of 76 characters. If wrap is 0, then no newlines are written.

The base64 utility exits 0 on success, and >0 if an error occurs.

uuencode(1)

base64 follows base64 as defined in RFC3548 and RFC4648.

A base64 utility first appeared in GNU Coreutils 6.0 (2006-08-15), FreeBSD 4.3, NetBSD 9

Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>

October 12, 2024 Linux