eh... help a unix newbie with find

HigherGround

Golden Member
Jan 9, 2000
1,827
0
0
find [path] -iname [pattern] -print

ex:

find /usr -iname lib -print

finds all instances of name lib or Lib or lIb, etc under the directory /usr
 

Jzero

Lifer
Oct 10, 1999
18,834
1
0
I haven't used it, but going through the man it looks like you can do

find -name <pattern> and you can use a regular expression to match regardless of case. Like you could do

find -name deeznuts|DEEZNUTS

maybe.....not 100% sure

 

gopunk

Lifer
Jul 7, 2001
29,239
2
0
$ find -iname ysf
Usage: find path-list [predicate-list]

so that's what i get when i search for a folder named ysf, that i know exists... i'm in the dir that i want to search in... what am i doing wrong?
 

Jzero

Lifer
Oct 10, 1999
18,834
1
0


<< he asked for case insensitive, so the argument is iname :p >>



Oh...hmmm....that doesn't appear in the Solaris 2.6 man page :)
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
cd dir/you/want/to/be/in <CR> #<CR> being carriage return
find . -name ysf -print

find is the command
. is where you want to start from. You could also use / to search the ENTIRE dir tree that you have permissions to read
-name ysf is pretty self explanatory. It works a little different if you want to add wildcards though
-print says to print it to screen.



EDIT: formatting...