How To Use Linux Xxd Command Tutorial For Hex and Binary Operations With Example?

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/use-linux-xxd-command-tutorial-hex-binary-operations-example/
PINTEREST
PINTEREST
INSTAGRAM

Linux provides a lot of tools for hexadecimal and binary manipulation. Xxd is one of the most popular tool. Xxd is generally used to create hex dump of the given file or standard input.

Help

Help

Help

Syntax

Dump to Hexadecimal

A file can be dumped into hexadecimal format just providing the file name. We will dump the file named Makefile in this example.

Dump to Hexadecimal

Dump to Hexadecimal

Dump From Commands Line or Standard Input

In previous example we have dumped from a file. xxd also supports dumping from standard input or console. We will provide - to specify input as standard input. At the end of the input we will stop input with CTRL+d shortcut.

Dump From Commands Line or Standard Input

Dump From Commands Line or Standard Input

Set Start Index

While dumping from a file there may be a lot of data those we are not interested. So we simply skiip them. xxd provides -s option to skip to the specified index. In this example we will skip first 5 lines and start from 6. line.

Set Start Index

Set Start Index

Set End Index

Previous example we have set the start index , we can also set the end index to limit printing data range in a file. We will use -l option with the value. In this example we set end index as 30 .

Set End Index

Set End Index

Set Column Length

xxd uses 16 as the default column length. This value can be changed with the -l option providing length value. In this example we will set column length as 12 .

LEARN MORE  Linux od Command Tutorial With Examples To Dump Files Octal Number Format

Set Column Length

Set Column Length

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/use-linux-xxd-command-tutorial-hex-binary-operations-example/
PINTEREST
PINTEREST
INSTAGRAM

You may also like...

1 Response

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)