Search for HEX string in files

Search for HEX string in files

Sometimes you need to find a needle in the proverbial haystack. For instance if you are looking for a specific HEX string in a number of files.

Introduction

I was working on a project and I needed to find and replace a HEX string in a number of files. The problem was that I did not know which files contained the HEX string.

Solution

Grep is a very powerfull command line tool to search the contents of files for patterns.

From stackoverflow.com it turns out an easy way to look for a specific HEX string in a number of files, is as follow:

grep -obUaPR "<your HEX string to look for>" *

I hope that this is useful to someone out there.

armand Friday 10 April 2015 - 12:07 pm | | Default

One comment

annieoroberts

I have read this article and I really found it helpful. You have the best collection of good articles. Reading is always my hobby. I love to read and it makes me to get good ideas, knowledge and helps to reduce stress. I would love to share your blog with my friends. Refer custom essay writing service Thank you.

annieoroberts, - 18-10-’17 10:02
(optional field)
(optional field)
Remember personal info?
Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.