- Base64 encode a string
1
2
$ echo "bla" | base64
YmxhCg==
- Base64 decode a string
1
2
$ echo "YmxhCg==" | base64 -d
bla
- Base 64 encode file text
1
2
3
4
5
$ touch test
$ echo "hello" > test
$ cat test | base64 > encodedtest
- Base 64 decode file text
1
2
$ cat encodedtest | base64 -d
hello