base64 命令详解

| 选择喜欢的代码风格  

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

base64 命令安装:


-bash/zsh: base64: command not found

# Windows (WSL2)
sudo apt-get update sudo apt-get install coreutils

# Debian
apt-get install coreutils

# Ubuntu
apt-get install coreutils

# Alpine
apk add coreutils

# Arch Linux
pacman -S coreutils

# Kali Linux
apt-get install coreutils

# CentOS
yum install coreutils

# Fedora
dnf install coreutils

# OS X
brew install base64

# Raspbian
apt-get install coreutils

# Dockerfile
dockerfile.run/base64

# Docker
docker run cmd.cat/base64 base64

base64 命令补充说明:


Base64 将 FILE 或标准输入编码或解码为标准输出,由 Simon Josefsson 编写。

base64 命令语法:


base64 [OPTION]... [FILE]

nano 命令选项:


-d, --decode
      decode data

-i, --ignore-garbage
      when decoding, ignore non-alphabet characters

-w, --wrap=COLS
      wrap encoded lines after COLS character (default 76).  Use 0 to disable line wrapping

--help display this help and exit

--version
      output version information and exit

base64 命令实例:


用 base64 命令,将文件内容编码为 base64 并将结果写入 stdout

base64 path/to/file

解码文件的 Base64 内容并将结果写入 stdout

base64 --decode path/to/file

base64 从 stdin 编码:

somecommand | base64

base64 从 stdin 解码:

somecommand | base64 --decode

base64 扩展阅读:




base64 命令评论