Questions tagged [xxd]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
89 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
317 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
5k 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. ...
3
votes
1answer
3k 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
235 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
19k 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
885 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
377 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
865 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 ...
6
votes
2answers
7k 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
560 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
116 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
265 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 ...
12
votes
1answer
30k 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 ...
39
votes
6answers
29k 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 ...