base64 flags & options
-d, --decode
Decode base64-encoded input back to original data.
echo "aGVsbG8=" | base64 -d
base64 -d encoded.txt > decoded.bin
-w, --wrap
Wrap output lines at a specified column width (default 76, 0 disables wrapping).
base64 -w 0 file.bin
echo "hello" | base64 -w 40
-i, --ignore-garbage
Ignore non-alphabet characters when decoding.
base64 -d -i messy-input.txt
Encoding (default)
Encode a file or stdin to base64 with no flags.
base64 file.bin > encoded.txt
echo "hello world" | base64