mirror of https://github.com/alibaba/arthas.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
579 B
Markdown
36 lines
579 B
Markdown
# base64
|
|
|
|
::: tip
|
|
base64 编码转换,和 linux 里的 base64 命令类似。
|
|
:::
|
|
|
|
## 对文件进行 base64 编码
|
|
|
|
```bash
|
|
[arthas@70070]$ echo 'abc' > /tmp/test.txt
|
|
[arthas@70070]$ cat /tmp/test.txt
|
|
abc
|
|
|
|
[arthas@70070]$ base64 /tmp/test.txt
|
|
YWJjCg==
|
|
```
|
|
|
|
## 对文件进行 base64 编码并把结果保存到文件里
|
|
|
|
```bash
|
|
$ base64 --input /tmp/test.txt --output /tmp/result.txt
|
|
```
|
|
|
|
## 用 base64 解码文件
|
|
|
|
```
|
|
$ base64 -d /tmp/result.txt
|
|
abc
|
|
```
|
|
|
|
## 用 base64 解码文件并保存结果到文件里
|
|
|
|
```bash
|
|
$ base64 -d /tmp/result.txt --output /tmp/bbb.txt
|
|
```
|