
Dump the contents of the file to a new file:Ģ. – Dump the contents of the file into a new fileįor example, to modify a binary file `filename.bin` using the xxd utility, run the following commands:ġ. To modify a binary file using the xxd utility, follow these steps: Step 5: Modifying Files with the xxd Utilityīesides just displaying the contents of a binary file, the xxd utility can also be used to make changes to the file.

You can also redirect the output of the xxd command to a text file using the standard output redirection operator `>`.įor example, to save the output of the xxd command to a file called `output.txt`, run the following command: – `-v` – displays the ASCII representation along with the hex outputįor example, the following command will display the contents of the binary file using 8 bytes per line: – `-u` – displays the output using uppercase letters – `-l` – specifies the number of bytes to be displayed – `-g` – specifies the number of bytes per group when displaying hex output – `-c` – specifies the number of bytes to be displayed in a single line – `-b` – displays the output in binary format Below are some of the most commonly used options: The xxd utility also supports several additional options to customize the way the output is displayed. This will display the contents of the binary file in hex format in the terminal. To use the xxd utility, navigate to the location of the binary file using the terminal, and then type the following command: In case it is not installed in your system, you can install it using the following command:Īlternatively, you can use the package manager available on your Linux distribution to install it.

The xxd tool is generally included in most Linux distributions.

This article will provide you with a step by step guide on how to use the xxd hex dumper utility in Linux. It is especially useful for viewing and analyzing the contents of binary files such as executables and image formats.

The xxd utility is a command-line tool available in Linux that allows you to dump a binary file in hexadecimal, octal, decimal or binary format.
