'find' command inconsistency

I am seeing a strange behavior of the 'find' command on AIX. As you can see,
the find command sometimes finds the file and sometimes does not based on how
many characters I specified between the wildcards.

I know all of these issues
can be resolved by using double quotes like "*est*". But I am posting this to
see if any of you can explain why it is able to find the file when I
specified *estf* but could not when I used *est*.


/home/testuser>uname -a

AIX myhost 3 5 00080B19D600

/home/testuser>ls -al /tmp/testuser

-rw-r--r--    1 testuser   staff             0 Jun 09 17:29 testfile

/home/testuser>find /tmp/testuser -name *est*


/home/testuser>find /tmp/testuser -name *estf*
/tmp/testuser/testfile

Hi.

Rerun both commands, but with echo in front of each one ... cheers, drl

The find util has co-dependency issues and likes its globbed args to be held...preferably between double-quotes.

Seriously, it does not always behave as expected on globbed -name args. You'll want to make sure and wrap your args in proper quotes to ensure that find can parse them properly.

find /tmp/testuser -name *est*   -o -name *estf* 
# versus ... 
find /tmp/testuser -name "*est*" -o -name "*estf*" 

The find command has no inconsistencies. If you don't quote parameters containing wildcards, they will be expanded before being passed to the find command if they match some existing filename. This is certainly true with your case.
As drl already wrote: echo will show you the root cause and demonstrate find isn't the issue here.