RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

od

Article Index
1. Name
2. Synopsis
3. Frequently used options
4. Examples

1. Name

od [man page] - dump files in octal and other formats

2. Synopsis

od [OPTION]... [FILE]...
od [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]]
od --traditional [OPTION]... [FILE] [[+]OFFSET[.][b] 
   [+][LABEL][.][b]] 

3. Frequently used options

t, --format=TYPE
      select output format or formats
-a    same as -t a,  select named characters
-c    same as -t c,  select ASCII characters or
      backslash escapes
-x    same as -t x2, select hexadecimal 2-byte 
      units
-l    same as -t dL, select decimal longs

4. Examples

Suppose that we have a file which contains:

$ echo -e "one\ntwo\nthree\nfour\nfive\n\nsix" > file 

od - create sample file
by default all output from od command comes as octal:

$ od file 

od - octal output
Fist column is a octal offset of a file and the following output is a file content in octal representation.With -c option we can instruct od command to represent values in a file as ASCII.

$ od -a file 

od - ASCII output :[[Image:od02.gif]] To get understanding of what a offset is, we can use wc command to get total number of bytes in the file and that convert it with bc to octal number.

$ wc -c file
$ echo "obase=8; ibase=10; 29;" | bc

od - bc to octal number

Share this linux post:

Submit od in Delicious Submit od in Digg Submit od in FaceBook Submit od in Google Bookmarks Submit od in Stumbleupon Submit od in Technorati Submit od in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download