bash – base64 decode command linux cli command

bash – base64 decode command linux cli command

Usage:

man base64

base64 file.txt > encoded.txt # to encode
base64 -d encoded.txt > decoded.txt  # to decode

You can also use

cat file.txt | base64 # to encode
cat encoded.txt | base64 -d # to decode

Note:

If you get base64: INVALID INPUT error, that means your input file is not a base64 encoded file( it can not be decoded with base64). Example try to decode your text file.

base64 -d file.txt

Output:

base64: invalid input

bash – base64 decode command linux cli command

bash – base64 decode command linux cli command

Leave a Reply

Your email address will not be published. Required fields are marked *