Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [xxd]

The tag has no usage guidance.

2
votes
2answers
534 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. ...
0
votes
0answers
42 views

Buffering issue when looking at netcat output

I have problem I am trying to understand: I am sending some UDP data to local host. It is a simple UDP packet with a counter. It counts up to 16 (0xF) and stops. When I grep the received data on the ...
2
votes
1answer
861 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
107 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-...
3
votes
2answers
11k 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
688 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: ...
3
votes
1answer
245 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
600 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 ...
5
votes
2answers
5k 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
395 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
86 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
195 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 ...
11
votes
1answer
21k 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
2k 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 ...
34
votes
6answers
24k 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 ...