Encode inline

echo -n 'Hello World!' | base64

Encode file (into file)

base64 ~/.bashrc > encoded-file.txt
cat ~/.bashrc | base64 > encoded-file.txt

Decode inline

echo -n "SGVsbG8gV29ybGQh" | base64 -d

Decode file (into file)

base64 -d encoded-file.txt > decoded-file.txt
cat encoded-file.txt | base64 -d > decoded-file.txt

About Living in the Shell
Obsessed with doing things in the shell, I’ve decided to share my daily struggles on living in the shell as terse but informative posts.