![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | 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 |
| Help Required: Command to find IP address and command executed of a user | loggedout | Security | 2 | 4 Weeks Ago 05:12 PM |
| Little bit weired : Find files in UNIX w/o using find or where command | jatin.jain | Shell Programming and Scripting | 10 | 09-19-2007 03:47 AM |
| how to find a file named vijay in a directory using find command | amirthraj_12 | UNIX for Dummies Questions & Answers | 5 | 10-25-2006 02:39 PM |
| command find returned bash: /usr/bin/find: Argument list too long | yacsil | Shell Programming and Scripting | 1 | 12-15-2003 02:38 PM |
| how to find a file in UNIX without find command? | bluo | Shell Programming and Scripting | 3 | 09-24-2003 08:47 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hy,
Does someone know how to setup "find" command allowing to find all files or directories according to a specific filter whatever case sensitive (I'm working on AIX platform 4.3.3). Example: find / -type d -exec grep .... Or perhaps using regular expresssion find / -type d -name *...$name...\* Thanks for your help |
| Forum Sponsor | ||
|
|
|
|||
|
Do a search on www.unix.com - search for find case sensitive. Livinfree and others seem to have answered this type of question before.
If that doesn't help, respond to this again. |
|
|||
|
Thanks for this suggestion but i've found nothing that i've not yet be done ...
In fact, i'm searching for a substitute of "-iname" option. I'd like to use a loop using a variable ($var for example) which should be passed to search command like "find": Ex.: for var in listing_var do find . -name $var ... ... done I've thought about syntax like : find . -type d -name *[A-z][$var] ... or find . -type d -exec grep -i $var But i've some problem to implement it. |
|
|||
|
This method filters entirely the path of your search. Ex.:
find . -type d | grep -i toto will show all directories and sub-directories containing "toto" in their paths like: ./toto ./test/ToTo ./toto/test (<- My PB !) |
|
|||
|
I'm not sure if you now have what you need or are looking for something else.
Original problem stated: setup "find" command allowing to find all files or directories according to a specific filter whatever case sensitive The suggested fix will do that. To add it to your script would be simple. If you need more than that, respond with more information. If you are looking to filter more out of the output from the find comand (piped to grep) you may need to be more specific in what you are greping for (add another grep with -v option to get rid of what you don't want?) |
|
|||
|
Thank to be indulgent about my english ...
Yours suggestions and remarks are correct and i noticed that precisions miss so: My complete problem is that i'm trying to set up a method (using find command for example) to filter all directories and sub-directories containing a predefined substring (like "toto") declared in a variable (because of a loop. see above for details). I try first to implement find command with "-exec" option and combine it with grep command: find . -type d -exec grep ... ... {} \; But it seems not to be the good way. ... While writting this reply, i thought about another way of solution. Perhaps have you any suggestions to improve and validate it: find . -type d -exec basename {} \; -ls | grep -i "toto" | nawk '{print 11}' |
|||
| Google UNIX.COM |