Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-15-2010, 02:17 PM   #1
Registered: Nov 2006
Posts: 66

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, 02:45 PM   #2
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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


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 08:01 PM writing to a specific line in a text file mrobertson Programming 3 12-30-2005 11:24 PM
Writing to a specific line in a text file mrobertson Programming 6 12-30-2005 05:02 PM
SED - display text on specific line of text file 3saul Linux - Software 3 12-29-2005 05:32 PM
Command line tools to Find files with specific text naps Linux - Software 5 11-15-2004 05:46 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:07 AM.

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