Unix / Linux

Monday, June 23, 2008

search replace multiple files, recursive

find . -type f -name "*.txt" -exec sed -i 's/oldstring/newstring/g' {} \;

Tuesday, June 10, 2008

total number lines of code wc -l

find . -type f -name "*.java" -exec cat {} \; | wc -l

find number of lines of code

find . -type f -name "*.java" -exec wc -l {} \;