Sortix cross-nightly manual
This manual documents Sortix cross-nightly. You can instead view this document in the latest official manual.
XXD(1) | General Commands Manual | XXD(1) |
NAME
xxd - make a hexdump or do the reverse.DESCRIPTION
xxd creates a hex dump of a given file or standard input. It can also convert a hex dump back to its original binary form. Like uuencode(1) and uudecode(1) it allows the transmission of binary data in a `mail-safe' ASCII representation, but has the advantage of decoding to standard output. Moreover, it can be used to perform binary file patching.OPTIONS
If no infile is given, standard input is read. If infile is specified as a `-' character, then input is taken from standard input. If no outfile is given (or a `-' character is in its place), results are sent to standard output.- -a | -autoskip
- Toggle autoskip: A single '*' replaces nul-lines. Default off.
- -b | -bits
- Switch to bits (binary digits) dump, rather than hexdump. This option writes octets as eight digits "1"s and "0"s instead of a normal hexadecimal dump. Each line is preceded by a line number in hexadecimal and followed by an ascii (or ebcdic) representation. The command line switches -r, -p, -i do not work with this mode.
- -c cols | -cols cols
- Format <cols> octets per line. Default 16 (-i: 12, -ps: 30, -b: 6). Max 256. No maxmimum for -ps. With -ps, 0 results in one long line of output.
- -C | -capitalize
- Capitalize variable names in C include file style, when using -i.
- -E | -EBCDIC
- Change the character encoding in the righthand column from ASCII to EBCDIC. This does not change the hexadecimal representation. The option is meaningless in combinations with -r, -p or -i.
- -e
-
Switch to little-endian hexdump. This option treats byte groups as words in little-endian byte order. The default grouping of 4 bytes may be changed using
- -g bytes | -groupsize bytes
- Separate the output of every <bytes> bytes (two hex characters or eight bit-digits each) by a whitespace. Specify -g 0 to suppress grouping. <Bytes> defaults to 2 in normal mode, 4 in little-endian mode and 1 in bits mode. Grouping does not apply to postscript or include style.
- -h | -help
- Print a summary of available commands and exit. No hex dumping is performed.
- -i | -include
- Output in C include file style. A complete static array definition is written (named after the input file), unless xxd reads from stdin.
- -l len | -len len
- Stop after writing <len> octets.
- -o offset
- Add <offset> to the displayed file position.
- -p | -ps | -postscript | -plain
- Output in postscript continuous hexdump style. Also known as plain hexdump style.
- -r | -revert
- Reverse operation: convert (or patch) hexdump into binary. If not writing to stdout, xxd writes into its output file without truncating it. Use the combination -r -p to read plain hexadecimal dumps without line number information and without a particular column layout. Additional Whitespace and line-breaks are allowed anywhere.
- -seek offset
- When used after -r: revert with <offset> added to file positions found in hexdump.
- -s [+][-]seek
- Start at <seek> bytes abs. (or rel.) infile offset. + indicates that the seek is relative to the current stdin file position (meaningless when not reading from stdin). - indicates that the seek should be that many characters from the end of the input (or if combined with +: before the current stdin file position). Without -s option, xxd starts at the current file position.
- -u
- Use upper case hex letters. Default is lower case.
- -v | -version
- Show version string.
CAVEATS
xxd -r has some builtin magic while evaluating line number information. If the output file is seekable, then the linenumbers at the start of each hexdump line may be out of order, lines may be missing, or overlapping. In these cases xxd will lseek(2) to the next position. If the output file is not seekable, only gaps are allowed, which will be filled by null-bytes.EXAMPLES
RETURN VALUES
The following error values are returned:- 0
- no errors encountered.
- -1
- operation not supported ( xxd -r -i still impossible).
- 1
- error while parsing options.
- 2
- problems with input file.
- 3
- problems with output file.
- 4,5
- desired seek position is unreachable.
SEE ALSO
uuencode(1), uudecode(1), patch(1)WARNINGS
The tools weirdness matches its creators brain. Use entirely at your own risk. Copy files. Trace it. Become a wizard.VERSION
This manual page documents xxd version 1.7AUTHOR
(c) 1990-1997 by Juergen WeigertAugust 1996 | Manual page for xxd |