Category Archives: Linux

Search and replace in multiple files

If you ever need to search and replace strings throughout a bunch of files here’s a neat, somewhat alternative, way to do it. for file in `ls **/*.txt`;do perl -pi -w -e ‘s/SEARCH_FOR_THIS/REPLACE_WITH_THIS/g;’ $file; done The nested ‘perl’ command can work kind of like ‘sed’.  Here are what the arguments being passed in mean: -e [...]

Java 101: building your java classpath from a lib folder

OK – I admit it – my IDE and tools make me weak in many ways.  I was just having the hardest time getting my maven-managed project to run from a basic “java my.class.ClassName” command line invocation.  Why?  Because the freaking classpath is a million miles away from being a concern to me anymore.  So, [...]