LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-09-2008, 05:18 AM   #1
snoopy1
Member
 
Registered: Jun 2007
Posts: 44

Rep: Reputation: 15
Grep query


I'm trying to recover from a backup disaster that's left me with 4mths of ajax coding down the pan. After deleting the files on XFS I made a dd image of the drive. I've now got to start the process of finding my text based files.

As I'm now back in Windows I've downloaded Grep for it. I've just started:

grep -i -a -B40 -A40 'credentials_login\s\=' d:\image > d:\file.txt

As each search takes a couple hours on the 79Gb file, can I ask whether this IS going to look for 'credentials_login ='? It also needs to look for the string anywhere in the line either start, middle, end, i.e it might not be at the start of the line. Do I need to use extra parameters to tell grep this?
 
Old 10-09-2008, 07:18 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Maybe use the -m option to tell grep to stop after it sees the first matched line with:

grep -i -a -B40 -A40 -m 1 'credentials_login' d:\image > d:\file.txt
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to understand pipes - Can't pipe output from tail -f to grep then grep again lostjohnny Linux - Newbie 15 03-12-2009 10:31 PM
interesting MySQL query/view query :s mjh Programming 3 03-25-2008 07:30 AM
"grep" query using wilcards logicalfuzz Linux - Newbie 7 01-29-2008 02:12 PM
help with mysql query: return nth rows in query hawarden Programming 2 07-31-2006 06:36 PM
ps -ef|grep -v root|grep apache<<result maelstrombob Linux - Newbie 1 09-24-2003 11:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:27 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