How search for files using regex in linux shell script [closed] How search for files using regex in linux shell script [closed] shell shell

How search for files using regex in linux shell script [closed]


Find all .py files.

find / -name '*.py'

Find files with the word "python" in the name.

find / -name '*python*'

Same as above but case-insensitive.

find / -iname '*python*'

Regex match, more flexible. Find both .py files and files with the word "python" in the name.

find / -regex '.*python.*\|.*\.py'


If simple shell regexps will suffice, then you can use find

find /linux -name "*python*"

Otherwise, I'd say use ack (http://betterthangrep.com/)


find / -name "python"

[filler text to meet min.]