views:

2829

answers:

9

On windows machine there are lots of third party editors available to edit a binary file. I belive there should be some thing similer buildin in the *nix systems as well. any idea how can i edit a binary file on unix?

+4  A: 

you can check wikipedia.

I prefer BIEW especially.

Francis
+5  A: 

with Vim or Emacs.

dsm
+1  A: 

There's lightweight binary editor, check hexedit. http://www.linux.org/apps/AppId_6968.html. I tried using it for editing ELF binaries in Linux at least.

Joset
+9  A: 

In vim You can type :%!xxd to turn it into a hexeditor. :%!xxd -r to go back to normal mode. xxd is shipped in a vim installation.

See here for some remarks about editing binary files with vim (boils down to :set binary to avoid trouble, use only the "R" or "r" command to change text, don't delete characters).

If You are an Emacs fan, see here for a guide on how to edit a binary file with Emacs.

Reef
Yes, this works, but it is more difficult to use because you need to work at keeping the xxd text formatted properly, and the ASCII decode on the side isn't automatic.
Shannon Nelson
More difficult than what? I'd like to remind that the question was about hexeditors shipped with *nix. Console users don't have much choice.
Reef
A: 

Bless is a high quality, full featured hex editor.

It is written in mono/Gtk# and its primary platform is GNU/Linux. However it should be able to run without problems on every platform that mono and Gtk# run. Main Features Bless currently provides the following features:

  • Efficient editing of large data files and block devices.
  • Multilevel undo - redo operations.
  • Customizable data views.
  • Fast data rendering on screen.
  • Multiple tabs.
  • Fast find and replace operations.
  • A data conversion table.
  • Advanced copy/paste capabilities.
  • Highlighting of selection pattern matches in the file.
  • Plugin based architecture.
  • Export of data to text and html (others with plugins).
  • Bitwise operations on data.
  • A comprehensive user manual.

copied from http://home.gna.org/bless/

Brad Gilbert
A: 

For small changes, I have used hexedit:

http://rigaux.org/hexedit.html

Simple but fast and useful.

bitozoid
+2  A: 

I like KHexEdit, which is part of KDE

Its "Windows style" UI is probably quite quick to learn for most people (compared to Vim or Emacs anyway :)


(Right click and 'View image' for full-size screenshot)

Jonik
+1  A: 
Shannon Nelson
Thanks. it present on my sunos system.any thing on hpux ?
Hemant
I don't know what all is on HPux, but since it is open source software you could probably find the source, compile and install it yourself.
Shannon Nelson
A: 

There are much more hexeditors on Linux/Unix....

I use hexedit on Ubuntu

sudo apt-get install hexedit
Osama ALASSIRY