Linux – Regex to Match Only Dirnames with Integers and Dots

findlinuxregular expression

Trying to write -regex for a find statement that shows only directories with dots and numbers, for example 1.2.3.4 oraz 1.2.3 or 1.3.4.5.6 was trying something like "-regex '\.[0-9.]+'", but it also shows dirs with letters. And I only want directories with numbers and dots.

Best Answer

-regex matches the whole path:

find /path -type d -regex ".*/[0-9.]+"
Related Question