본문 바로가기

기초공부/LINUX

[Linux]명령어 hexdump

NAME

hexdump, hd — ASCII, decimal, hexadecimal, octal dump


SYNOPSIS

hexdump [-bcCdovx] [-e format_string] [-f format_file] [-n length] [-s skip] file ...
hd [-bcdovx] [-e format_string] [-f format_file] [-n length] [-s skip] file ...


DESCRIPTION

The hexdump utility is a filter which displays the specified files, or the standard input, if no files are specified, in a user specified format.
hexdump utility는 특정한 파일 (또는 파일이 지정되지 않을 경우에는 표준입력)을 사용자가 지정한 형식으로 보여주는 필터다.


The options are as follows:

-b One-byte octal display. Display the input offset in hexadecimal, followed by sixteen space-separated, three column, zero-filled, bytes of input data, in octal, per line.

-c
One-byte character display. Display the input offset in hexadecimal, followed by sixteen space-separated, three column, space-filled, characters of input data per
line.

-C
Canonical hex+ASCII display. Display the input offset in hexadecimal, followed by sixteen space-separated, two column, hexadecimal bytes, followed by the same sixteen bytes in %_p format enclosed in ``|'' characters.
Calling the command hd implies this option.

-d Two-byte decimal display. Display the input offset in hexadecimal, followed by eight space-separated, five column, zero-filled, two-byte units of input data, in unsigned decimal, per line.

-e format_string Specify a format string to be used for displaying data.

-f format_file Specify a file that contains one or more newline separated format strings. Empty lines and lines whose first non-blank character is a hash mark (#) are ignored.

-n length Interpret only length bytes of input.

-o Two-byte octal display. Display the input offset in hexadecimal, followed by eight space-separated, six column, zero-filled, two byte quantities of input data, in octal, per line.

-s offset Skip offset bytes from the beginning of the input. By default, offset is inter‐ preted as a decimal number. With a leading 0x or 0X, offset is interpreted as a hexadecimal number, otherwise, with a leading 0, offset is interpreted as an octal number. Appending the character b, k, or m to offset causes it to be interpreted as a multiple of 512, 1024, or 1048576, respectively.

-v Cause hexdump to display all input data. Without the -v option, any number of groups of output lines, which would be identical to the immediately preceding group of output lines (except for the input offsets), are replaced with a line comprised of a single asterisk.

-x Two-byte hexadecimal display. Display the input offset in hexadecimal, followed by eight, space separated, four column, zero-filled, two-byte quantities of input data, in hexadecimal, per line.


For each input file, hexdump sequentially copies the input to standard output, transforming the data according to the format strings specified by the -e and -f options, in the order that they were specified.

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

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