LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-25-2006, 07:17 PM   #1
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Rep: Reputation: 30
Question need help with find syntax


This is what I normally do

find /path -exec grep syntaxtofind {} \; -print

This time I want to search through logs for multiple sites

so I need a find syntax that only checks certain subdirs

My structure is as follows:

/home/httpd/vhosts/SITE1/statistics/logs
/home/httpd/vhosts/SITE2/statistics/logs
/home/httpd/vhosts/SITE3/statistics/logs

find /home/httpd/vhosts/****/statistics/logs/ -exec grep syntaxtofind {} \; -print

How can I get it to search only the log dirs for each site?

Thanks,
 
Old 04-25-2006, 09:20 PM   #2
tells
Member
 
Registered: Jun 2003
Location: Peoria, IL
Distribution: Ubuntu (home) / RHEL (work)
Posts: 65

Rep: Reputation: 15
find /home/httpd/vhosts -type f -wholename '*logs*'
 
Old 04-25-2006, 09:54 PM   #3
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Original Poster
Rep: Reputation: 30
So does it become?

find /home/httpd/vhosts -type f -wholename '*logs*' -exec grep syntaxtofind {} \; -print

Coz I get:

find: invalid predicate `-wholename'
 
Old 04-25-2006, 10:59 PM   #4
tells
Member
 
Registered: Jun 2003
Location: Peoria, IL
Distribution: Ubuntu (home) / RHEL (work)
Posts: 65

Rep: Reputation: 15
Does the find command by itself show the file names you want to search? Leave off the -exec stuff and see if the error comes from the find command or after you add the exec settings.
 
Old 07-12-2006, 05:48 PM   #5
stefaandk
Member
 
Registered: Jun 2005
Distribution: Centos
Posts: 215

Original Poster
Rep: Reputation: 30
Same thing yes

# find /home/httpd/vhosts -type f -wholename '*logs*'
find: invalid predicate `-wholename'

Thx
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
syntax SmithSmith123 Linux - Newbie 2 11-17-2005 04:45 PM
Help with lp syntax slick_willie Programming 2 02-03-2005 07:18 PM
Need help with special syntax on the 'find' command Seventh Linux - General 4 01-20-2005 01:16 PM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 06:09 PM
syntax lynger Linux - Software 6 12-02-2003 01:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:44 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration