[Cialug] Help finding file?

Barry Von Ahsen barry at vonahsen.com
Mon Jan 2 16:11:33 CST 2012


there's usually also -iname:

 -iname pattern
              Like -name, but the match is case insensitive.


find / -iname \*partial file name\*


-barry



On 01/02/2012 03:54 PM, Don Ellis wrote:
> I see your grep ignores case -- yes, that would be a bit different.
> 
> On Mon, Jan 2, 2012 at 3:53 PM, Don Ellis <don.ellis at gmail.com> wrote:
>> The grep is not necessary; it can be included in the find command itself:
>>
>>    find / -name \*partial_name\*
>>
>> That last element (the -name field) accepts a number of shell pattern
>> matching characters (not a regex, but good enough for most file name
>> patterns).
>>
>> From the find man page:
>>
>>     -name pattern
>>             True if the last component of the pathname being examined matches
>>             pattern.  Special shell pattern matching characters (``['', ``]'',
>>             ``*'', and ``?'') may be used as part of pattern.  These characters
>>             may be matched explicitly by escaping them with a
>> backslash (``\'').
>>
>> There are some other options visible on the man page. -exec allows
>> executing a command on each item found, -ls produces a listing much
>> like 'ls -l'.
>>
>> --Don Ellis
>>
>>
>> On Mon, Jan 2, 2012 at 3:43 PM, kristau <kristau at gmail.com> wrote:
>>> There are several ways to skin that particular cat. This is the one I use
>>> most often:
>>>
>>> find / | grep -i <partial file name>
>>>
>>> On Jan 2, 2012 3:37 PM, "Tom Sellers" <tomsellers2001 at yahoo.com> wrote:
>>>>
>>>> What is the Ubuntu linux command to locate a file anywhere on the disk?  I
>>>> need to have it search the whole directory structure not just the current
>>>> directory for the file.
>>>>
>>>> If I use find by itself it lists all directory items but it I list the
>>>> file name after the find command it only seems to search the local directory
>>>> and tells me that it is not there.
>>>>
>>>> Surely there is a command to do this.  I just haven't been able to find
>>>> it.
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> http://cialug.org/mailman/listinfo/cialug



More information about the Cialug mailing list