Awesome OS X Command Line

A curated list of shell commands and tools specific to OS X.

“You don’t have to know everything. You simply need to know where to find it when necessary.” (John Brunner)

Camel case transforms

  * Credit: sidharthkuruvila
  * Source:
  * Takes a camel cased identifier name and returns an underscore separated
  * name
  * Example:
  *     camelToUnderscores(“thisIsA1Test”) == “this_is_a_1_test”

def camelToUnderscores(name: String) = “[A-Z\\d]”.r.replaceAllIn(name, {m =>
  “_” +

 * Takes an underscore separated identifier name and returns a camel cased one
 * Example:
 *    underscoreToCamel(“this_is_a_1_test”) == “thisIsA1Test”

def underscoreToCamel(name: String) = “_([a-z\\d])”.r.replaceAllIn(name, {m =>

rsync IDE project files

The jury is still out on whether to version control the IDE files (see for example this question on StackOverflow). I recently tend to agree with Anton and lend towards not version-controlling or at least keeping them separate.

This little rsync script can help moving all project files to a separate hierarchy so that you can manage them separately from your source tree:

rsync -av \
–filter=’+ */’ \
–filter=’+ .classpath’ \
–filter=’+ .project’ \
–filter=’+ **/*.iml’ \
–filter=’+ .idea/***’ \
–filter=’- *’ \
–prune-empty-dirs $1 $2

Thanks Shane Meyers for the insight into rsync filter patterns.