본문 바로가기

기초공부/LINUX

[Linux]명령어 xxd

NAME

xxd - make a hexdump or do the reverse.


SYNOPSIS

xxd -h[elp]
xxd [options] [infile [outfile]]
xxd -r[evert] [options] [infile [outfile]]


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 advan‐ tage of decoding to standard output. Moreover, it can be used to perform binary file patching.
xxd는 받은 파일 또는 표준입력의 16진수를 생성한다. 또한 16진수를 원래 이진 형태로 변환한다.


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.
infile이 없다면 표준 입력을 읽는다. infile이 '-'문자로 지정되어 있다면, 표준입력을 읽는다. outfile이 없거나 '-'문자로 지정되어 있다면 결과는 표준 출력으로 보낸다.
Note that a "lazy" parser is used which does not check for more than the first option letter, unless the option is followed by a parameter. Spaces between a single option letter and its parameter are optional. Parameters to options can be specified in decimal, hexadecimal or octal notation. Thus -c8, -c 8, -c 010 and -cols 8 are all equivalent.


-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 octets per line. Default 16 (-i: 12, -ps: 30, -b: 6). Max 256.


-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. This option only applies to hexdump, leaving the ASCII (or EBCDIC) repre‐ sentation unchanged. The command line switches -r, -p, -i do not work with this mode.


-g bytes | -groupsize bytes separate the output of every bytes (two hex characters or eight bit-dig‐ its each) by a whitespace. Specify -g 0 to suppress grouping. 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 octets.


-o offset add 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.
반대로 작동:16진수를 binary로 변환한다(또는 덧붙인다).


-s [+][-]seek start at 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 posi‐ tion). 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.

'기초공부 > LINUX' 카테고리의 다른 글

[Linux]명령어 nc  (0) 2019.03.02
[Linux]명령어 ssh  (0) 2019.03.02
[Linux]명령어 hexdump  (0) 2019.02.23
[Linux]명령어 cat, touch  (0) 2019.01.29
[Linux]명령어 mkdir, rmdir  (0) 2019.01.28