0

Suppose I have a file named

some_file_name.ext

Now I want this file to be found out with find command some part of filename like:

find filelocation -type f -name 'some\|name'

I have tried doing this with grep and awk but with no luck and even tried all command from this link

jkp
  • 3

1 Answers1

3

Arguments to find -name are simple shell globs, and the default conjunction is logical AND - so

find location -type f -name '*some*' -name '*name*'

will find regular files whose names contain both some and name in any order. OTOH if you want to find files whose names contain some and name in order, it's simply

find location -type f -name '*some*name*'

or

find location -type f -name 'some*name*'

if the name should start with the string some.

steeldriver
  • 81,074