Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Find file that contains "....." (command in Unix)

by parv (Parson)
on Mar 28, 2003 at 10:46 UTC ( [id://246445]=note: print w/replies, xml ) Need Help??


in reply to Re: Find file that contains "....." (command in Unix)
in thread Find file that contains "....." (command in Unix)

Well, here is yet another solution assuming gnu grep...

grep -F -r -I -l '.....' . | grep '.txt$'

...first part of the pipeline recursively, -r, (downword only) searches text files, -I, for ..... in the current directory, ., listing only the file names found. Second part filters the file names which lists only those ending in '.txt'.

Here is one more and bit more robust (to be run in "test" directory; see OP)...

find . -type f -name '*.txt' -print0 | xargs -0 grep -F -l '.....'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://246445]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-26 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found