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

No Perl needed solution:
find . -type f -exec grep "\.\.\.\.\." /dev/null {} \;
Or if you have a modernish grep:
grep -r "\.\.\.\.\." .

Update: The OP requested the file name, the solutions print all lines containin the pattern. This does what the OP wants:

find . -type f -exec grep -q "\.\.\.\.\." {} \; -exec echo 'Found {}' + \;

CU
Robartes-

Replies are listed 'Best First'.
Re: Re: Find file that contains "....." (command in Unix)
by parv (Parson) on Mar 28, 2003 at 10:46 UTC

    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 '.....'
Re: Re: Find file that contains "....." (command in Unix)
by waswas-fng (Curate) on Mar 28, 2003 at 15:45 UTC
    or just find . -type f -exec grep -lq "\.\.\.\.\." {} \;

    -Waswas