LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-04-2009, 07:27 PM   #16
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76

malekmustaq:

Thanks for your post. Your example works. But I've found it applies to the more general case in which an entire tree must be search for a given string. So,if I have ~/.d1/.d11/.d111/.f1 containing string 'Yo soy aquel.', then
~# grep -r aque ./.d1
will output
./.d1/.d11/.d111/.f1:Yo soy aquel.
Furthermore, even
~# cd .d1
~/.d1# grep -r aque .
will print the same path.

What I used to do is 'grep -r PATTERN *' and this didn't work if there was a component beginning with '.' in the
path to the file containing PATTERN. But, as i92guboj suggests, it will work previous 'shopt -s dotglob'.

Thanks again, malekmustaq and I hope you remain a slacker,
the number 2 distribution in the Linux-distributions sub-
forum list (although it should be considered the first, given that Linux from Scratch, as the name implies, is not
properly speaking a distribution). Hasta mas ver.
 
  


Reply

Tags
grep


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
Truncate from beginning of the file lvprabhu Programming 12 05-25-2010 09:43 PM
renaming file names beginning with "-" prashln Linux - General 5 05-01-2010 01:47 AM
Add text to the beginning of file names xebix Linux - Newbie 5 10-02-2008 12:43 AM
!? element names beginning with number break javascript??? UMG:Chicken_Soüp Programming 1 01-27-2008 11:12 PM
Force grep NOT to print file names smart_sagittari Linux - Newbie 5 04-25-2005 01:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:43 AM.

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