Raspberry Pi

How to Install Hex Editor on Raspberry Pi OS

All the files and data stored on any computing device are in the form of numbers or ASCII code and by editing or changing them, the layout of the overall file can be altered. Just like any other computing device, the data of Raspberry Pi is also stored in the form of numbers or ASCII and to access them, there is an editor called Hex Editor, which allows users to view and edit the hex code of a file or other data. It includes different options that help you change the ASCII values of the files on the Raspberry Pi system.

This article is a detailed guide to easily install Hex Editor on Raspberry Pi OS.

How to Install Hex Editor on Raspberry Pi OS?

To install Hex Editor on Raspberry Pi, carefully follow the steps-by-steps instructions below:

Step 1: Before installing any new package the first step is to update the repository so that one gets the latest update about the packages:

$ sudo apt update

Step 2: After updating, now it is time to upgrade the packages by running the below-mentioned command:

$ sudo apt upgrade

Step 3: Now after updating the repository, run the below-mentioned command to install Hex Editor on Raspberry Pi system from the system repository:

$ sudo apt install hexedit

Step 4: After installation, the Hex editor can be used to open any file in its hex or ASCII form and it can be edited too. To open the Hexadecimal raw form of any file, run the below-mentioned command along with the name of file:

Syntax

$ hexedit <file-name-or-path>

Example

$ hexedit /home/pi/test.jpg

Here, I have opened a test jpg file using Hex Editor.

As soon as you run the above command, the hexadecimal form of the file will appear on the screen which is editable too:

You can now edit the Hex code inside any file and after the changes, you can save it using “CTRL+X”.

For help, you can open Hex Editor help section using the following command:

$ man hexedit

There you will see different options to work with the ASCII or hexadecimal code; like you can format the display, maximize the display, or change the colors in the file.

Remove Hex Editor from Raspberry Pi

To remove Hex Editor from Raspberry Pi, use the below-mentioned command:

$ sudo apt remove hexedit

Conclusion

Hex Editor is an open-source editor for editing the hexadecimal or ASCII code of files and it can be installed on Raspberry Pi from the official repository using the apt command. After successfully installing the editor, you can open the Hexadecimal form of any file by running the hexedit command along with the name of that file. You can also use different options with hexedit command and edit the files according to yourself.

About the author

Zahra Zamir

An Electronics graduate who loves to learn and share the knowledge, my passion for my field has helped me grasp complex electronics concepts and now I am here to share them with others.