Find -regex is slower than find | grep
问题 I have a script which looks for a file using a regular expression. The code was the following: find $dir | grep "$regex" The script run a bit too slow and I want to optimise it. The search takes some time to perform and I would like to get better performance out of it. I've tried this attempt: find $dir -regex ".*${regex}.*" I was expecting slightly faster results as no extra process is created to parse the regular expression. However the result was different and to my astonishment the