You may already have Homebrew installed. Let’s see if you do. Type
which brew
If you do not have Homebrew installed you will not get an error message! No message will be provided at all! Instead you will see the same prompt as before. In that case, we need to install Homebrew.
If Homebrew is installed, you will see some text like /usr/local/bin/brew
followed by the command prompt on the next line.
Follow below to install or skip to Update Homebrew if it is installed.
Now it’s time to install Homebrew, the de facto package manager for OS X. If you’ve never heard of a package manager, think of it as an App Store of free command line programs.
To get started, run the following command.
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/install/master/install)"
TIP: If you do not have XCode installed, be sure to agree when asked to install the XCode Command Line Tools, which is necessary for installing Homebrew. This can take up to 30 minutes to download and install, depending upon your connection.
If you’ve previously installed Homebrew, now’s a good time to update it by running the following command.
brew update
If it’s been a while since the last update, you’ll see something like this.
Otherwise, you’ll see something like this.
TIP: Run this command periodically as Homebrew doesn’t auto-update itself. :sweat:
To verify Homebrew is installed correctly, run the following command.
brew doctor
If Homebrew is you’ll see something like this:
If Homebrew is not installed, you will see something like:
-bash: brew: command not found
Now that we’ve verified that homebrew was installed, we can use it to install a useful command for us called tree!
Type brew install tree
into the command line.
Onces that’s complete, you should now be able to type tree and your terminal will display all of your directories and folders in an awesome looking tree view format!