LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-24-2014, 08:14 AM   #1
GameoverII
LQ Newbie
 
Registered: Jun 2014
Posts: 2

Rep: Reputation: Disabled
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.
 
Old 06-24-2014, 08:32 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
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.
 
Old 06-24-2014, 09:49 AM   #3
GameoverII
LQ Newbie
 
Registered: Jun 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
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
 
Old 06-24-2014, 10:40 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating an alias in ksh that uses grep and includes 'grep -v grep' doug248 Linux - Newbie 2 08-05-2012 02:07 PM
newbie needs help for grep and awk parker Programming 1 08-12-2003 04:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration