← Back
base64 bash

Encode and decode base64 like a boss

If you play kubernetes, this could be handy:

Encode

base64 <<< my-string-to-encode

Decode

base64 -D <<< my-encoded-string-to-decode

🖖


EDIT: It adds the new line! Remove the last Cg== characters

Pablo's idea:

base64 <<< "my-string-to-encode\n" | sed 's/Cg==//'