Download your favorite Linux distribution at LQ ISO.
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 06-04-2009, 07:27 PM   #16
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,604

Original Poster
Rep: Reputation: 51


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.



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_Sop 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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:14 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration