base64

编码/解码文件,和linux的base64命令类似,但不支持管道符

命令选项 描述
-d, --decode 解码
-i, --input <file> 输入文件路径
-o, --output <file> 输出文件路径
-M, --sizeLimit <number> 限制结果输出大小
-h, --help 帮助
<file> 文件路径

示例

# 创建待编码文件
[arthas@70070]$ echo 'abc' > /tmp/test.txt

# 编码文件
[arthas@70070]$ base64 /tmp/test.txt
YWJjCg==

# 指定编码输出文件
[arthas@70070]$ base64 --input /tmp/test.txt --output /tmp/result.txt
[arthas@70070]$ base64 -i /tmp/test.txt -o /tmp/result.txt

# 解码文件
[arthas@70070]$ base64 -d /tmp/result.txt
abc

# 将解码结果保存为文件
[arthas@70070]$ base64 -d /tmp/result.txt -o /tmp/bbb.txt