Find files with certain extensions

findregular expression

How can I use find to find all files that have a .xls or .csv extension? I have seen a -regex option but I don't know how to use it.

Best Answer

Why not simply use this:

find -name "*.xls" -o -name "*.csv"

You don't need regex for this.

If you absolutely want to use regex simply use

find -regex ".*\.\(xls\|csv\)"
Related Question