Questions tagged [xxd]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
7
votes
2answers
1k views

How to print zeros and ones of a file

Long story short: how to print in a terminal the binary digits constituting a file e.g. a library .so or a simple text .txt file PC hardware works with electrical signal (basically it's an ON/OFF ...
2
votes
1answer
74 views

How to modify a hex string to LE-format before passing it to `xxd -r` to view its binary contents?

The hex string 0068732f6e69622f represents the ASCII string /bin/sh, when it's stored in memory in LE-format. Is there any Linux utiltity that will take the hex string and reverse it bytes (...
1
vote
0answers
56 views

What is wrong with this gzip file [closed]

I downloaded a data dump of papers from arxiv.org The papers are gzipped archives, which can be opened up to see the internal latex, and other files/images used to form teh paper pdf. One archive in ...
1
vote
1answer
154 views

How to `watch` output of `xxd` or `hexdump` command?

My tool is wtiting binary chars to stdout and I can view it in hex with # ./md /dev/ttyUSB0 | xxd 0000000: 6f03 1100 0003 0084 8400 0000 0900 0a00 o............... 0000010: 0008 0004 0000 0000 2c00 ...
-6
votes
1answer
161 views

Just started learning Kali Linux 3 weeks ago need help with maybe a hex dump?

For an assignment I was given this problem: What has 8 faces and cannot see? followed by this character set: ...
1
vote
1answer
91 views

Patch Multiple Strings in a Binary file

I have a binary file type (many instances of these files) where I would like to replace the string "DC-GX850" with "DMC-GX95". Fortunately the two strings are of equal length. The ...
0
votes
2answers
96 views

Parse text file with addresses, byte values, and comments to binary file

I'm attempting to start with a file in the following form: 00: 42 ; byte 0 is 0x42 / d 01: 52 ; byte 1 is 0x52 / r 02: 62 ; byte 2 is 0x62 / D 03: 72 ; byte 3 is 0x72 / R 07: 1f ; bytes 03..0e are ...
3
votes
2answers
5k views

What is the difference between the od, hd, hexdump and xxd commands?

What is the difference between the od, hd, hexdump and xxd commands ? They are all commands for dumping files and they can all dump it in various formats such as hexadecimal, octal or binary. Why ...
2
votes
1answer
1k views

Make xxd display the the byte offset at the top column?

So Im using emacs which has a stupendous hexl-mode to view the byte offset in a file right over the hex values similar to: 87654321 0011 2233 4455 6677 8899 aabb ccdd eeff 0123456789abcdeff ...
2
votes
2answers
6k views

xxd with 64 bit addresses

I find xxd to be nice and convenient for simple manipulation of binary data in the terminal. However it has a limitation in that all addresses outputted by the program is limited to 32 bits. E.g. ...
4
votes
1answer
7k views

Hex dump only the beginning and the end of a file with xxd [duplicate]

I am looking for a command to display three .png files using xxd, displaying the first two and last two lines of the hexadecimal for each. I have used the command below to display one file at a time ...
0
votes
1answer
519 views

Outputting the binary of a file to a text editor

I have read that you can use the terminal command xxd -b to see the binary of a file. I used this command and it does show the binary but has non-binary listed to the left as line numbers and non-...
2
votes
2answers
20k views

Unix: Using the xxd Command on a ppm File

I am fairly new to unix and am having trouble understanding what some of the commands do.For example, when I use xxd on a ppm file (i.e. xxd image.ppm) I get an output like this: 00000000: 5036 0a31 ...
1
vote
1answer
1k views

How to make "xxd" place spaces between the hex values?

I am using the following command to read the output of one terminal from another terminal: xxd -p /dev/pts/0 But there is no spaces between the hex values, for example I get something like this: ...
2
votes
1answer
667 views

Make xxd break lines

For showing the content of a file with both formatted text and binary data inside in another post on SE I couldn't decide on wheather to show the ASCII rendered output or a the xxd output. As a ...
2
votes
1answer
1k views

Why does xxd not show the byte order mark?

I have a Java class which the compiler refuses to compile due to \ufeff at the start of the file. I can view the fact that the BOM is present by vim -b file.java, but neither xxd nor hexdump show the ...
7
votes
2answers
12k views

Any way to send just "\n" in Telnet?

I'm wondering if there's any way to get telnet to send only a \n, not a \r\n. For example, if one process is listening on a port like this, to print the bytes of any traffic received: nc -l 1234 | ...
2
votes
2answers
978 views

“xxd -p” alternative for HP-UX - how to get the same results with “xd”?

I have a command which is very handy at work. It searches for a certain STRING inside some hex raw files with FILENAME. The command which I always used in Linux systems is: find . -name '**FILENAME*...
0
votes
1answer
135 views

Hex has unknown character / in the output

I need to create a Rc2Key variable and then convert this to hexadecimal. I have done this with two commands. The Rc2Key variable has to be 16 characters long, so in my test module I used "...
2
votes
1answer
371 views

Unified diff-alikes with xxd

patch(1) on FreeBSD does not support null bytes. With GNU diff/patch I could handle multiple files containing null bytes with one patch, but xxd (which handles null bytes) does not seem to support ...
19
votes
1answer
47k views

XXD output without line breaks

Can I tell xxd to not print any line breaks in its output and have my dump as one continuous line? [user@localhost] : ~ $ echo -n "this is a long line and xxd is going to take multiple lines to print ...
3
votes
3answers
4k views

Split binary data of fixed byte offset by byte position?

I have binary data which I review by xxd -ps in hex format. I notice that the byte distance is 48300 (=805*60) bytes between two headers where the separator is fafafafa. There is the beginning of ...
44
votes
6answers
38k views

How to dump a binary file as a C/C++ string literal?

I have a binary file I would like to include in my C source code (temporarily, for testing purposes) so I would like to obtain the file contents as a C string, something like this: \x01\x02\x03\x04 ...