Questions tagged [od]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
504 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 ...
0
votes
0answers
40 views

How octal dump (od) works with -to4 and how to reverse it? (CTF task)

I have a text file with some data. If i make octal dump with -to4 option I'll get that: user@host:~$ cat file | od -An -to4 out -> 14533267563 14135060544 So, what -to4 actually do and how to ...
0
votes
1answer
429 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 ...
2
votes
2answers
269 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 ...
0
votes
1answer
48 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 ...
1
vote
1answer
778 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
64 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
624 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
86 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
1k 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
25 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
286 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
671 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
301 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
209 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 ...
3
votes
3answers
744 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,...
1
vote
2answers
392 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
6k 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
145 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
61k 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
705 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
615 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
724 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
892 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
110 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
216 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
323 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
6k 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.
14
votes
2answers
30k 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?
49
votes
2answers
33k 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. ...
10
votes
7answers
21k 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 ...