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 [od]

The tag has no usage guidance.

1
vote
1answer
169 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 ...
0
votes
2answers
46 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 ...
0
votes
1answer
271 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 -...
2
votes
1answer
49 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 ...
4
votes
3answers
617 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 ...
1
vote
1answer
19 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 ...
-2
votes
1answer
118 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 ...
2
votes
2answers
492 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?
1
vote
1answer
202 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 ...
0
votes
3answers
179 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 ...
2
votes
3answers
487 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,...
2
votes
2answers
361 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 ...
4
votes
1answer
5k 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 $ ...
1
vote
1answer
104 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 ...
0
votes
1answer
1k 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 ...
7
votes
3answers
50k views

Convert binary mode to text mode and the reverse option

By the following way I convert a simple binary file into a text file 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 ...
9
votes
1answer
3k views

Removing line numbers from `od`'s output

Is there any flag to od to make it not output line numbers in the result?
3
votes
1answer
610 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?
4
votes
1answer
466 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 ...
1
vote
0answers
642 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 ...
2
votes
1answer
764 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 ...
2
votes
1answer
96 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 ...
0
votes
1answer
201 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 ...
5
votes
1answer
320 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 ...
4
votes
2answers
5k 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.
11
votes
2answers
28k 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 ...
11
votes
2answers
3k 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?
38
votes
2answers
28k 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. ...
8
votes
7answers
19k 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$...
4
votes
2answers
1k 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 ...