Find all regular files with case insensitive pattern '*$1*' ($1 expands to first positional parameter and falls back to empty string when not given) under current directory tree and execute a command given by $2 (falls back to 'file' command when $2 is not given) with each of those files as arguments
find . -type f -iname '*'"${1:-}"'*' -exec ${2:-file} {} \;