![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can I know find syntax to find given date files | bache_gowda | Shell Programming and Scripting | 3 | 03-26-2008 03:37 AM |
| making a recursive find more useful.. | spanish_tony | UNIX for Dummies Questions & Answers | 3 | 03-14-2007 02:48 AM |
| find file with date and recursive search for a text | rosh0623 | UNIX for Advanced & Expert Users | 10 | 08-16-2006 11:27 AM |
| awk syntax question | hcclnoodles | Shell Programming and Scripting | 2 | 10-28-2004 09:45 AM |
| Performing a non-recursive find in Unix | christallott | UNIX for Advanced & Expert Users | 3 | 09-06-2002 06:13 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Question: non-recursive find syntax
Hello, I am trying to search a directory for all files matching "G*" without looking in sub-directories "success" and "error". I've searched this forum and found the following syntax, but can't make it work:
find . \( ! -name success -prune -name error -prune \) -type f -name "G*" Have consulted the man pages for find, experimenting with -depth but no luck. Please let me know what I'm doing wrong. Thanks, alexkav |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
find . \( -name success -prune \) -o \( -name error -prune \) -o -name "G*" -print
|
|
#3
|
|||
|
|||
|
Perfect. Thank you!
|
|
#4
|
|||
|
|||
|
help again
Hello agian, is it possible to adjust the "find" command to only find files beginning with "G" and followed by numbers?
For example: good: G102030 bad: GFI_UPLOAD.log Thanks, alexkav |
|
#5
|
|||
|
|||
|
Ok, here's using grep:
find . \( -name success -prune \) -o \( -name error -prune \) -o -name "G*" -print) | grep '[0-9]\{6\}' Thanks, alexkav |
|
#6
|
||||
|
||||
|
what if i don't know what subdirectories there are?
Quote:
|
|
#7
|
||||
|
||||
|
Look in the faq section for the answer.
|
||||
| Google The UNIX and Linux Forums |