Linux base64 Guide - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux base64 Guide
Complete beginner-friendly guide to base64 on Linux, covering Arch Linux, CachyOS, and other distributions including encoding, decoding, and data conversion.
Table of Contents
base64 Basics
Encode Text
Basic usage:
# Encode text
echo "Hello World" | base64
# Encodes text to base64
Decode Text
Decode:
# Decode base64
echo "SGVsbG8gV29ybGQ=" | base64 -d
# -d = decode (decodes base64)
Encoding
Encode String
Text encoding:
# Encode string
echo "Hello World" | base64
# Output: SGVsbG8gV29ybGQ=
Encode File
File encoding:
# Encode file
base64 file.txt
# Encodes file content
Decoding
Decode String
Text decoding:
# Decode string
echo "SGVsbG8gV29ybGQ=" | base64 -d
# Output: Hello World
Decode File
File decoding:
# Decode file
base64 -d encoded.txt > decoded.txt
# Decodes and saves to file
File Operations
Encode to File
Save encoded:
# Encode and save
base64 file.txt > encoded.txt
# Saves encoded content
Decode to File
Save decoded:
# Decode and save
base64 -d encoded.txt > decoded.txt
# Saves decoded content
Troubleshooting
base64 Not Found
Check installation:
# base64 is part of coreutils
# Usually pre-installed
# Check base64
which base64
Summary
This guide covered base64 usage, encoding, decoding, and data conversion for Arch Linux, CachyOS, and other distributions.
Next Steps
- gpg Guide - Encryption
- Security Configuration - Security setup
- base64 Documentation:
man base64
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.