By Alvin Alexander. Last updated: June 4, 2016
Yesterday I needed to find all the files in two subdirectories (/tmp and /home) on a Linux platform ending with the characters ".java", that contained the string "commit". Here's the little ditty that made that happen:
find /tmp /home -type f -name "*.java" -exec grep 'commit' {} \; -print
For finding files and directories on Unix systems (or Cygwin) the find
command rules.