From: Gary Watson Date: 2005-12-27T12:57:53+09:00 Subject: Found a neat trick for doing recursive one-liners This is probably something everyone in here already knows about, but I thought it was cool enough that I wanted to post about it. If you want to create a one liner to say search all the *.txt files in and under the current directory for text matching "Hello", you can do this find -name '*.txt' -exec ruby -ne 'print if /Hello/' '{}' ';' I know you can do this in pure ruby in like 3 lines if you use the Find module, but I really wanted to do it with a one liner. Earlier I tried something like this ruby -ne 'print if /Hello/' `find -name '*.txt'` unfortunately that version would fail if there were any spaces in the filenames.