Questions tagged [od]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
0 answers
72 views

Should programs terminate on ENOSPC error?

In bash, the command hexdump -C /dev/urandom > hexdump.txt does not terminate. It keeps going indefinitely, even if the filesystem is full. read(0, "\326\210L0\rL<\177\207\214\3\2237\vi\315\...
munikiel's user avatar
2 votes
2 answers
2k views

How to format hexdump as xxd, possible for xxd -revert?

I wish to dump the raw content of a SD card into a file for inspection. Most parts of it are zeroes. Learnt from this SuperUser answer I could use pv to show the progress of od and hexdump. Both ETA ...
midnite's user avatar
  • 335
1 vote
1 answer
68 views

With what letters does OD utility separate each byte things, according to POSIX?

On my Termux, for example, the following can be obtained: $ od -A n -t x1 /dev/urandom | head -n 2 e3 5d bf 57 fb 8b 63 06 4a 18 fe 28 73 8f 3e c0 9f 08 6b d4 2d 38 2c 68 3c 51 83 1e 71 7b 57 2b As ...
user avatar
8 votes
2 answers
10k 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 ...
Nicryc's user avatar
  • 285
0 votes
1 answer
4k views

Convert received data bytes in serial to hex text

Hi now I write bytes data (for eg, \x00\x11\x22) from my PC to serial port of my device running unix at the ttyS1 port. I am able to print the data using either cat /dev/ttyS1 od -x < /dev/ttyS1 ...
GeneCode's user avatar
  • 157
2 votes
2 answers
2k views

Undump od (octal or hex dump) in Version 6 Unix

od (octal dump) command is implemented in Unix since Version 1. However, I couldn't find a reverse command in the Version 6 Unix manual (1975). Modern ways of reversing od with either xxd or sed do ...
Andriy Makukha's user avatar
1 vote
1 answer
480 views

od command to print all the values

I am running the od command as od -b myfile to convert a file I have into image pixels. I need to see all the values but because they are too many the command prints the following: 0000000 000 000 ...
Michail's user avatar
  • 13
1 vote
1 answer
2k views

Removing control M characters from a given file and to remove newline character if it is the only character in the entire file

We have a file named as abc.txt and its a empty file. Due to some junk or control M characters, the file size is populated as 5 byte file. In order to have clean file we are using dos2unix command to ...
Rak kundra's user avatar
0 votes
2 answers
443 views

Is it correct that `od` can't show binary number?

Is it correct that od can't show binary number? I can't find an argument to provided to its -t option for showing binary number. I feel it is natural to expect od to show binary number, or do I miss ...
Tim's user avatar
  • 100k
0 votes
1 answer
2k views

Convert text file to non-iso extended ascii file

I have a file which is Non-ISO Extended ASCII type. I can't see its content just by opening it normally via cat or vim. However, I'm able to see its content in readable form with this command... od -...
yogiboy's user avatar
2 votes
1 answer
179 views

Understanding the od utility output in regards to floats 'od -t f'

I am making my own od utility based on the Single UNIX Specification and I am confused on how the representation of floats is handled e.g. od -t f. I have a perfectly functioning utility otherwise ...
Zeno of Elea's user avatar
5 votes
3 answers
4k views

Explanation for the meaning of content of the /var/run/utmp file

I would like to understand the content of the following file system /var/run/utmp. When I use the command od to open it I see the following: [john@iceman ~]$ od -c /var/run/utmp 0000000 002 \0 \0 ...
user avatar
1 vote
1 answer
47 views

Insert OD output in another file

I have output from an od command (without access to the original file). Is it possible for me to get the binary data and insert it into another file with a programming language, like python? Here is ...
Jordan's user avatar
  • 11
-2 votes
1 answer
723 views

How does od treat symbols after `\x7f`?

The following command passes to od symbols from \x00 to \xff: $ seq 0 255 | awk '{printf("%c", $0)}' | od -c But what I get is: 0000000 \0 001 002 003 004 005 006 \a \b \t \n \v \f \r 016 ...
x-yuri's user avatar
  • 3,273
3 votes
2 answers
1k views

What are those numbers on the left of od output?

I checked the od man page, but it does not explain this. What do the numbers on the left column of the od output mean?
revelt's user avatar
  • 135
1 vote
1 answer
623 views

How to prevent octal dump (od) returning?

I am trying to read some output from /dev/ttyUSB0, using od on Ubuntu. So I used this command: od -x --endian=big < /dev/ttyUSB0 When I used it yesterday it was not blocking and just showed stuff ...
user206420's user avatar
0 votes
3 answers
277 views

How to improve performance in generating MAC addresses with od?

In my script I need to randomly generate MAC addresses. The code below is from a larger script extracted, that's why the MAC address calculation is in a separate function. This works fine with the ...
Bruno Bieri's user avatar
4 votes
3 answers
3k views

Portable one-byte per line hex dump

Suppose we want a minimalist one-byte per line ASCII hex dump. Under Linux using GNU od, this works: echo foo | od -An -tx1 -w1 -v Output: 66 6f 6f 0a But that won't work with BSD derivatives,...
agc's user avatar
  • 7,073
1 vote
2 answers
542 views

What does the '005' mean in the output of linux command od?

I have a file called input_file, the following is the contents of input_file: $ cat input_file 1 2 3 4 5 6 7 8 9 then I run the following command: $ od -to2 input_file ...
Ren's user avatar
  • 263
7 votes
2 answers
11k views

Octals 302 240 together seem to correspond to non-breaking space

By looking at a particular line of a text file (say, the 1123th, see below), it seems that there is a non-breaking space, but I am not sure: $ cat myfile.csv | sed -n 1123p | cut -f2 Lisztes feher $ ...
tflutre's user avatar
  • 205
1 vote
1 answer
169 views

od prints extra value [closed]

I have a binary file containing 4-byte floats. I want to print these floats using od. However, od prints one additional value at the very first position. What is going on here? The file looks like ...
Andreas Unterweger's user avatar
0 votes
1 answer
2k views

Commands for data manipulation of binary to octave/hex formats?

I need to convert binary data to hex/octave/any suitable format and back to binary when I am splitting one big 1GB file into files containing 777 events each which are not of the same size such that ...
Léo Léopold Hertz 준영's user avatar
15 votes
3 answers
113k views

Convert binary mode to text mode and the reverse option

I converted a simple binary file into a text file with: od –t x1 Check.tar | cut –c8- > Check.txt Which gives a content similar to: 64 65 76 2f 6e 75 6c 6c 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
maihabunash's user avatar
  • 7,031
13 votes
1 answer
6k views

Removing line numbers from `od`'s output

Is there any flag to od to make it not output line numbers in the result?
Ram Rachum's user avatar
  • 1,805
3 votes
1 answer
1k views

Can't use `od` command with directories

I'm trying to use the od command in a directory in OSX but it doesn't proceed and it results in the error message: od: .: Is a directory Could you please help me with it or any equivalent command?
Amr M.Elsaid's user avatar
5 votes
1 answer
997 views

Interpreting octal dump without options

$ echo "hello" | od 0000000 062550 066154 005157 0000006 I know that the first column represents the byte offset. But I don't see how the other numbers are formed. According to man the above should ...
user2820379's user avatar
2 votes
0 answers
1k views

OpenWRT missing OD (octal dump)

I have a bash function using od command. Now I'm trying to run in on OpenWRT and see that in has not od. Also can't find it using install from opkg, because I can't find it. Is there a possibility to ...
Tschwen's user avatar
  • 131
2 votes
1 answer
1k views

Understanding `od -c` output

I've got a text file that I'm trying to debug an encoding issue in. I ran the file through od -c and got the following output: 3457540 , " t e x t " : " 302 241 Q u 303 251 My ...
Eric Andres's user avatar
2 votes
1 answer
207 views

understanding od -a option

In Linux, the --type a option in od is explained as --type=       Select the format in which to output the file data … a      named ...
erch's user avatar
  • 4,980
0 votes
1 answer
289 views

Why is od calculating decimal values wrong?

This question is related to the answer from enzotib to the question: How could I use Bash to find 2 bytes in a binary file, increase their values, and replace? This converts the two bytes into its ...
erik's user avatar
  • 17.1k
4 votes
1 answer
340 views

od emulation for directories

I was wondering why od(1) used to work in UNIX but doesn't work in GNU/Linux. There is a nice answer on serverfault. The next question is, are you aware of any tools that can emulate od behavior to ...
sakisk's user avatar
  • 2,873
6 votes
3 answers
14k views

How to change the default line length for od and hexdump

Is there any way to change the default line length for the od and hexdump commands? Can't see anything apropriate in the man pages.
newenglander's user avatar
14 votes
2 answers
34k 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 ...
user avatar
14 votes
2 answers
4k views

Can hd and od replace each other?

hd and od are both dump viewers of binary content. Can hd be used wherever od is and vice versa?
Tim's user avatar
  • 100k
79 votes
2 answers
71k views

Output from ls has newlines but displays on a single line. Why?

I think I may be overlooking a relatively fundamental point regarding shell. Output from the ls command by default separates output with newlines, but the shell displays the output on a single line. ...
theconnorpower's user avatar
12 votes
7 answers
30k views

get numeric ASCII value for a character

I'm trying to write a shell script which asks for an ASCII character in the range A-Z or a-z and returns its equivalent numerical value. For example, the output might look like the following: scarlet$...
Host Post's user avatar
  • 207
4 votes
2 answers
2k views

How is the octal 2-byte output calculated from od

I'm struggling to work out what the octal 2-byte output from the od command is. I understand the octal output (-b flag) but the octal 2-byte is a mystery to me (-o) Can someone shed some light on how ...
theconnorpower's user avatar