Roger Knecht | f841bb8 | 2022-09-03 13:15:04 +0000 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+: |
| 2 | |
| 3 | xxd command |
| 4 | =============== |
| 5 | |
| 6 | Synopsis |
| 7 | -------- |
| 8 | |
| 9 | :: |
| 10 | |
| 11 | xxd <interface> <dev[:part]> <file> |
| 12 | |
| 13 | Description |
| 14 | ----------- |
| 15 | |
| 16 | The xxd command prints the file content as hexdump to standard out. |
| 17 | |
| 18 | interface |
| 19 | interface for accessing the block device (mmc, sata, scsi, usb, ....) |
| 20 | |
| 21 | dev |
| 22 | device number |
| 23 | |
| 24 | part |
| 25 | partition number, defaults to 1 |
| 26 | |
| 27 | file |
| 28 | path to file |
| 29 | |
| 30 | Example |
| 31 | ------- |
| 32 | |
| 33 | Here is the output for a example text file: |
| 34 | |
| 35 | :: |
| 36 | |
| 37 | => xxd mmc 0:1 hello |
| 38 | 00000000: 68 65 6c 6c 6f 20 77 6f 72 6c 64 0a 00 01 02 03 hello world..... |
| 39 | 00000010: 04 05 .. |
| 40 | => |
| 41 | |
| 42 | Configuration |
| 43 | ------------- |
| 44 | |
| 45 | The xxd command is only available if CONFIG_CMD_XXD=y. |
| 46 | |
| 47 | Return value |
| 48 | ------------ |
| 49 | |
| 50 | The return value $? is set to 0 (true) if the file is readable, otherwise it returns a non-zero error code. |