LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-15-2010, 01:17 PM   #1
EnderX
Member
 
Registered: Nov 2006
Posts: 64

Rep: Reputation: 15
SuSE 9.3 - searching for specific text in file - Command line options?


Pretty much see title, I guess.

I'm trying to track down the source of a set of messages that appeared in the database log files on a remote machine our client uses. From the context and the timing (daily M-F, but not always at the same time), I suspect the messages are coming when the users run some web-based report that's interacting with the database. The problem is, we've got enough different reports that I'm not sure where to begin trying to track this one down.

Is there some variation of the command line find command, or some alternate command, that will allow me to look inside the file(s) being investigated to attempt a text match? I know it can be done in the GUI search on our main server in the office, but as pointed out, the problem here is that I only have remote access, via Putty, into the system that these messages are appearing on. I've looked over the find manpage (man find), but don't see anything like that in it.

Any suggestions as to where I should start?
 
Old 04-15-2010, 01:45 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Depends on whether the files you're examining are text or not.

You could just do a
grep -ril "text goes here" /path/to/start/looking


That should tell you the names of matching files, w/o displaying
any garble if it's a binary.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
SED - replace text in file on specific line 3saul Linux - Software 1 03-04-2006 07:01 PM
vb.net writing to a specific line in a text file mrobertson Programming 3 12-30-2005 10:24 PM
Writing to a specific line in a text file mrobertson Programming 6 12-30-2005 04:02 PM
SED - display text on specific line of text file 3saul Linux - Software 3 12-29-2005 04:32 PM
Command line tools to Find files with specific text naps Linux - Software 5 11-15-2004 04:46 AM


All times are GMT -5. The time now is 08:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration