LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Newbie grep help (https://www.linuxquestions.org/questions/linux-newbie-8/newbie-grep-help-4175509012/)

GameoverII 06-24-2014 08:14 AM

Newbie grep help
 
Hi,

I need some help with some grep statements. I have a file that I created that contains some 22 suspicious hashes from some .exe's.
I want to compare them against a directory that contains thousands of other known malicious files and see if any of them match.

Here's what I've tried so far:
grep -i "A4878AS785ASD8715A545SAD" /Master/Cases/Malicious_Hashes.csv

Then I tried:
grep /Master/Cases/06232014_01/JAN2014_hashes.txt > /Master/Cases/Malicious_hashes.csv

Any help would be appreciated. Thanks.

schneidz 06-24-2014 08:32 AM

there is a recurse option (-r) for grep to descend into directories.

the basic format is
Code:

grep string /list/of/files
if there is still a question please provide a few line example before-and-after.

GameoverII 06-24-2014 09:49 AM

So I tried the -r and it seems to be working. How well it works is unknown cause it has the processor pegged right now.

I tried:
grep -r *MD5 Hash /mnt/windows_mnt

grail 06-24-2014 10:40 AM

If you do not quote the string you are looking for the shell will expand the asterisk prior to being used. Generally this is not the desired effect.


All times are GMT -5. The time now is 12:51 PM.