LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-11-2015, 10:48 AM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
Searching for string inside files


Dear all,
I would like to search inside my files (and into all subdirectories) for a string that might look like

Oxford
oxford
oxfordian
1fxord2
0xford9

(the common part is the xford)

What I am currently trying is the
grep -RilF '*xford*'


althoug my research does not return anything for days now.

What I am doing wrong?

Regards
Alex
 
Old 06-11-2015, 11:05 AM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Alex:
Try
Code:
find -type f -exec grep -il xford  {} \;
John
 
1 members found this post helpful.
Old 06-12-2015, 02:59 AM   #3
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Original Poster
Rep: Reputation: 45
Thansk a lot I am trying it
 
Old 06-12-2015, 03:46 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,850

Rep: Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309Reputation: 7309
you do not need *, just write:
grep -RilF xford <dir>
* has a special meaning
 
1 members found this post helpful.
Old 06-12-2015, 06:48 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
I like both the offered solutions. In the future, do not allow a search to continue for "days". If you truly expect that the occurrence of that string is extremely rare, then create a few test files to validate your search criteria, or in the more normal case, do realize that there's something wrong with your search spec if it stays up for some long time with no results.
 
  


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
searching a particular string in all files of a single folder dinakumar12 Linux - Newbie 5 06-27-2011 02:23 PM
Searching for text string in all files ortizmj Linux - Newbie 2 03-03-2011 01:03 PM
searching text inside .pdf/.chm files? paperplane Linux - Newbie 2 02-03-2008 07:31 AM
searching for a string of charcters in some files hhegab Programming 2 04-16-2005 05:07 PM
searching inside text files minm Linux - Newbie 2 01-08-2005 11:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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