How to search recursively the files of a given directory [Grepdir]

A guy called Chris Karakas has made a very nice script to search through all files in a directory (and all subdirectories).

The original can be downloaded from and saved as /usr/local/bin/grepdir. If chmoded a+x then it can be used by all.

A note on ubuntu: I had to change the “/bin/sh” to “/bin/bash” in order to get it working (it was complaining about “/usr/local/bin/grepdir: 16: Syntax error: “(” unexpected”).

Update: A updated version that should read the shell automatically from the export list can be downloaded from