EN
Bash - decode base64 file
5 points
In this short article we would like to show how to decode file that is encoded with base64 using Bash.
Case 1: when file contains single base64 line:
xxxxxxxxxx
1
cat input_base64.txt | base64.exe -d > output_data.ext
Case 2: when file contains multiple base64 lines:
xxxxxxxxxx
1
cat input_base64.txt | tr -d '\r\n' | base64.exe -d > output_data.ext
2
3
# OR: cat input_base64.txt | base64.exe -w 0 -d > output_data.ext
Where: tr -d '\r\n'
removes newline characters.