How to run external shell commands in SBT (Simple Build Tool)

To run external shell commands in SBT, first start SBT from your operating system command line:

$ sbt

Then run the consoleProject task/command:

> consoleProject

After some output you’ll see this prompt:

scala>

Now you can execute shell commands by including them in double quotes, and following them by an exclamation mark, like this:

scala> "ls -al" !

For more information, see the SBT consoleProject documentation page.