1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/osx/base64.md

29 lines
735 B
Markdown
Raw Normal View History

2016-01-18 17:20:20 +08:00
# base64
> Encode or decode file or `stdin` to/from base64, to `stdout` or another file.
> More information: <https://keith.github.io/xcode-man-pages/base64.1.html>.
2016-01-18 17:20:20 +08:00
- Encode a file to `stdout`:
2016-01-18 17:20:20 +08:00
`base64 {{[-i|--input]}} {{path/to/file}}`
2016-01-18 17:20:20 +08:00
- Encode a file to the specified output file:
2016-01-18 17:20:20 +08:00
`base64 {{[-i|--input]}} {{path/to/input_file}} {{[-o|--output]}} {{path/to/output_file}}`
2016-01-18 17:20:20 +08:00
- Wrap encoded output at a specific width (`0` disables wrapping):
2016-01-18 17:20:20 +08:00
`base64 {{[-b|--break]}} {{0|76|...}} {{path/to/file}}`
2016-01-18 17:20:20 +08:00
- Decode a file to `stdout`:
2016-01-18 17:20:20 +08:00
`base64 {{[-d|--decode]}} {{[-i|--input]}} {{path/to/file}}`
- Encode from `stdin` to `stdout`:
`{{command}} | base64`
- Decode from `stdin` to `stdout`:
`{{command}} | base64 {{[-d|--decode]}}`