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
-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 将 FILE 或标准输入编码或解码为标准输出,由 Simon Josefsson 编写。
base64 [OPTION]... [FILE]
-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
并将结果写入 stdout:
base64 path/to/file
解码文件的 Base64 内容并将结果写入 stdout:
base64 --decode path/to/file
base64 从 stdin 编码:
somecommand | base64
base64 从 stdin 解码:
somecommand | base64 --decode