2025-03-14 21:59:59 -06:00
|
|
|
# base64
|
|
|
|
|
|
|
|
|
|
> Encode or decode file or `stdin` to/from base64, to `stdout` or another file.
|
2025-05-08 12:26:01 -06:00
|
|
|
> More information: <https://keith.github.io/xcode-man-pages/bintrans.1>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Encode a file to `stdout`:
|
|
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
`base64 {{[-i|--input]}} {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Encode a file to the specified output file:
|
|
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
`base64 {{[-i|--input]}} {{path/to/input_file}} {{[-o|--output]}} {{path/to/output_file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Wrap encoded output at a specific width (`0` disables wrapping):
|
|
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
`base64 {{[-b|--break]}} {{0|76|...}} {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Decode a file to `stdout`:
|
|
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
`base64 {{[-d|--decode]}} {{[-i|--input]}} {{path/to/file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Encode from `stdin` to `stdout`:
|
|
|
|
|
|
|
|
|
|
`{{command}} | base64`
|
|
|
|
|
|
|
|
|
|
- Decode from `stdin` to `stdout`:
|
|
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
`{{command}} | base64 {{[-d|--decode]}}`
|