Removing Aptana's *.tmp files

Every developer knows and loves GREP, the great search utility available on all Unix-based systems; while it does a great job searching, the options are a little lacking. One such option is restricting the search to only specific file types/extension. Luckily that functionality can be easily wrapped up in a handy script.

Create the script file:

[code]cd /bin[/code] [code]sudo vim grepp[/code]

(You can name the script whatever you want, I named mine "grepp" for easier typing!)

Paste the following code:

[code]grep $1 $(find . -name ‘*.php’ -or -name ‘*.inc’ -or -name ‘*.tpl’)[/code]

(To search only .php, .inc and .tpl files.)

Save and quit:

[code][ESCAPE][/code] [code]:w [ENTER][/code] [code]:q [ENTER][/code]

Set the file permissions:

[code]sudo chmod 0777 grepp[/code]

Run the script within any directory you'd like to search in:

[code]grepp “foo bar”[/code]