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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-11-2015, 10:48 AM
|
#1
|
Senior Member
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203
Rep:
|
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
|
|
|
06-11-2015, 11:05 AM
|
#2
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep: 
|
Alex:
Try
Code:
find -type f -exec grep -il xford {} \;
John
|
|
1 members found this post helpful.
|
06-12-2015, 02:59 AM
|
#3
|
Senior Member
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203
Original Poster
Rep:
|
Thansk a lot I am trying it
|
|
|
06-12-2015, 03:46 AM
|
#4
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,223
|
you do not need *, just write:
grep -RilF xford <dir>
* has a special meaning
|
|
1 members found this post helpful.
|
06-12-2015, 06:48 AM
|
#5
|
Moderator
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,953
|
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.
|
|
|
All times are GMT -5. The time now is 09:54 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|