The tag has no wiki summary.

learn more… | top users | synonyms

13
votes
4answers
861 views

Is there an alternative to sed that supports unicode?

For example: sed 's/\u0091//g' file1 Right now, I have to do hexdump to get hex number and put into sed as follows: $ echo -ne '\u9991' | hexdump -C 00000000 e9 a6 91 ...
2
votes
2answers
48 views

Hexdump of a string starting at new lines?

Say I have a multi-line strings, but the entries on it are short; if I try to hexdump, then I get something like this: echo "something is being written here" | hexdump -C #00000000 73 6f 6d 65 74 ...
0
votes
1answer
89 views

Convert serialized Java object to human readable

I have object of class class X { private DateTime dt; "constructor, set/get" } I have one instance of this object serialized in file.bin. I want to show content of `file.bin on the Linux ...
18
votes
4answers
1k 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 ...
1
vote
1answer
51 views

Hexdump binary file while honoring separators

I have a binary file where records are separated by newlines. hexdump just dumps everything with a fixed column width. Is there a tool to hexdump this file, while honoring the newline separator? (Any ...
1
vote
1answer
69 views

hexedit: change number of columns (bytes per line)

I am using hexedit to show/edit disk MBR (512 Bytes, copied with dd). When I open the file, hexedit displays the file as 9 columns, 4 bytes per column (36 bytes per line). That is very unfortunate. I ...
3
votes
1answer
451 views

Why do I get different output from hexdump compared to xxd?

Why does hexdump seem to miss out parts of the file, while xxd does not? The file is 32 bytes. So xxd output is correct. $ xxd test.bin 0000000: 8888 8888 8888 8888 8888 8888 8888 8888 ...
5
votes
3answers
353 views

Achieving hexdump-like format, that includes binary strings, on the command line?

I really like hexdump, especially because you can define a custom format; say: $ echo -e '\x00\x01\x02\x03' | hexdump -v -e '1/1 "%_ad: "' -e '4/1 "%02X "' -e '1/1 " : "' -e '4/1 "%_p"' -e '1/1 "\n"' ...
3
votes
3answers
476 views

Why do ls and hexdump disagree about my file size?

I have a file I created (in vim), for testing purposes (testing UTF-8 output in an SSH client). Odd things, however, are happening to this file. I wondered what bytes were in the file, so I used ...
2
votes
3answers
161 views

Why can't I edit links and directories directly?

There are programs such as hexedit that allow one to edit each bit of a file, and as I keep hearing that in Unix "everything is a file", I tried to edit some directory, expecting bytes referring to ...
3
votes
1answer
181 views

What does `*` mean using hexdump -C?

I've been doing an exersice in attempt to understanding some of what's going on under the hood of a program. I wrote a small C program, and compiled it on i386 Linux (Ubuntu 12.04) using gcc. I then ...
0
votes
1answer
227 views

stream a certificate to stdout to download it in php

Related Questions : when downloading certficate binary data , result is invalid certificate Download binary stream data from browser using PHP with web service “ downloaded file is corrupted ” ...
5
votes
2answers
2k views

Does hexdump respect the endianness of its system?

On my machine I get the following output when I run these commands: $ echo foos > myfile $ hexdump myfile 6f66 736f 000a The output from hexdump is little-endian. Does this mean that my machine ...
3
votes
2answers
7k views

How to interpret an octal or hex dump of a binary file?

The binary file has strings and some numbers, If I do od -c filename or strings filename, I can see the strings properly. But, what about numbers? They are in some weird format. The text after doing ...