Bootstrap FreeKB - Linux Commands - base64 command
Linux Commands - base64 command

Updated:   |  Linux Commands articles

The base64 command is used to encode or decode a base 64 string. In this example, "Hello World" is encoded.

~]$ echo "Hello World" | base64


The -d or --decode option is used to decode an encoded string. 

~]$ echo SGVsbG8gV29ybGQK | base64 --decode
Hello World


The base64 command can also be used to convert a .pfx or .p12 file into a base 64 string.

~]# base64 foo.pfx
dYnOXssQp . . .


By default, the output will be split at every 77th character. The following sed command can be used if you want the output to be inline.

~]# base64 foo.pfx | sed ':label; N; $! b label; s|\n||g'


Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee


Add a Comment

Please enter 25cdb4 in the box below so that we can be sure you are a human.