Problem with find command.

I'm trying to display the full file name (including the full path) and file size of all files whose name (excluding the path) is longer than 10 characters.

I came up with find path -type f -name ".{10, }" -printf "%s %p\n", but I'm getting a "find: path: No such file or directory". What's wrong with my command?

Are you actually including the word "path" in your command? You are supposed to replace that with the directory that find is going to search for the matching files.

Also the -name option only accepts wildcards of the type used for matching filenames, whereas .{10, } is a more complex regular expression type syntax.

Try something like this:

find . -type f | while read f ; do b=$(basename $f); [[ ${#b} -ge 10 ]] && ls -l $f ; done

thanks. the previous command didn't really work that well even with the correct path.