LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 08:27 PM   #16
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,225

Original Poster
Rep: Reputation: 49

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


All times are GMT -5. The time now is 03:43 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration