find files without extension

Let say I have:


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.


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

Asked By: pawel7318


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.

Answered By: fduff
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.