Scala SBT tool history commands

When you're using the SBT tool with your Scala projects, it can be helpful to list your “sbt history,” the history of your SBT commands. Courtesy of the SBT tool itself, here are the history commands you can use from the sbt command line:

History commands:

!!        Execute the last command again
!:        Show all previous commands
!:n       Show the last n commands
!n        Execute the command with index n, as shown by the !: command
!-n       Execute the nth command before this one
!string   Execute the most recent command starting with 'string'
!?string  Execute the most recent command containing 'string'

A cool thing I just learned is that this history is contained within each project, so if you move to Project1, fire up SBT, and then look at the history with these commands, that history will be different than a different project, such as Project2. (I just learned this when I started working on a project I hadn’t touched in almost three months.)

This website is a little one-man operation. If you found this information helpful, I’d appreciate it if you would share it.

Add new comment

The content of this field is kept private and will not be shown publicly.

Anonymous format

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul type> <ol start type> <li> <pre>
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Enter the characters shown in the image.