Under a directory, there are files with underscore in their filenames. I want to get such files and print them on screen.
The command I used is:
find ./ -type f -name '[a-z0-9]*\.java'
It's not a regex, it's a pattern.
* means "any characters", as in
ls *. Use
-regex instead of
-name to actually use a regex, but note that it has to match the whole path, not just the filename.
find . -type f -regex '.*/[a-z0-9]*\.java'