command line

How to set the SBT logging level

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 18.13, “Setting the SBT Log Level.”


You’re having a problem compiling, running, or packaging your project with SBT, and need to adjust the SBT logging level to debug the problem. (Or, you’re interested in learning about how SBT works.)


Set the SBT logging level in your build.sbt file with this setting:

Teleport: The Unix/Linux ‘cd’ command, improved

Table of Contents1 - The Teleport command2 - Teleport command help3 - For basic use, tp is just like cd4 - Basic teleporting5 - Listing your teleport history6 - Teleport by number7 - Bash completion with Teleport8 - Teleport aliases9 - Adding/creating a teleport alias10 - Using a teleport alias11 - Listing your teleport aliases12 - Removing an alias13 - Teleport command - summary14 - Teleport command - download

Summary: By keeping a history of the directories you've visited, the Teleport command is an improvement on the Unix/Linux cd command. By having a memory, Teleport lets you jump from one directory to any previously visited directory, easily.

January, 2015 Update: The Teleport command now supports Bash completion. For more details on this, see the Github file.

How to install a ‘deb’ file on Debian Linux (dpkg, apt)

As a quick note, this page has some good background information on how to install a deb package file from the command line on Debian Linux (which in my case is Ubuntu 16.04). The short answer is that if you have a deb file named google-chrome-stable_current_amd64.deb, you’ll want to run these two commands, one after the other, as shown:

Hints for writing Unix tools

Marius Eriksen has a good article titled Hints for writing Unix tools. Some key points: a) consume input from stdin, produce output to stdout; b) output should be free from headers or other decoration; c) output should be simple to parse and compose. There’s much more to it than that, and it’s a good read (or reminder).

How to replace newline character with sed on Mac OS X (macOS)

I don’t have much time to explain this today, but ... if you want to see how to use the sed command on a Mac OS X (macOS) system to search for newline characters in the input pattern and replace them with something else in the replacement pattern, this example might point you in the right direction.

How to set the Java version on Mac OS X (macOS) systems alvin July 20, 2016 - 8:11pm

I don’t remember where I first found this line of code, but if you put it in your Mac OS X ~/.bash_profile file, it’s an easy way to set your Mac Java version:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

I can confirm this works with the Bash shell on Mac OS X 10.10. When I run the java -version command after opening a new Mac Terminal window, the output is 1.8.0_25.

A slightly more difficult way to set your Mac Java version is to look under the /Library/Java/JavaVirtualMachines directory to see which versions are installed, and then manually set the version.