Bash – find files without extension

bashfindshellwildcards

Let say I have:

foo.txt
bar
baz.ooo

If I use ls -1 !(*.*) then I'll get only bar on the output. Great, now I wish to have same results with find – some find -regex that will do the job.

NOTE:

find -name !(*.*) is not the answer as !(*.*) in it is still Bash's glob which I can NOT use.

Best Answer

you could use: find . -type f ! -name "*.*" the ! negates the following expression, here a filename that contains a '.'

you can also use the -maxdepth option to reduce the search depth.

Related Question