Spring Cleaning for the bootcamp

So I’m getting ready to start Hack Reactor’s bootcamp and I figured I’d get my machine re-vitalized. Today I performed a clean installation of macOS and started everything from scratch. This means I also need to set up my dev environment. Iv’e chosen to scrap my old .bash_profile and start a new one with code I’d actually understand and understand its purpose. This will also serve me as practice with the command line. The current OS at time of writing is High Sierra version 10.13.4 (17E199). It’s been updated and now ready to start shifting gears.

My first step was to download my most used apps and get them into the Applications folder. When it came to Sublime Text I knew that I had to set up the symlinks (symbolic links). This is so that I could invoke Sublime from the command line. At this point I’d forgotten how to do this and kept getting this error:

ln: /usr/local/bin/sublime: No such file or directory

I searched online for a while and found many resources but they didn’t help me. So let me review the process in case you need to do this now:

  1. Make sure Sublime Text 3 is installed (I have that one installed)
  2. You need to have a directory where you place your binaries (/usr/local/ bin is for the applications most people use on a every day basis).
/usr/local/bin

I didn’t have it so I ran this in the terminal:

mkdir -p /usr/local/bin

Make sure to remember that the -p is used to create all missing directories leading up to the new one.

3. Add into your .bash_profile or .bashrc the following:

export PATH=/usr/local/bin:$PATH

This is so that the PATH environment variable is loaded each time you run the terminal.

4. Create the symlink:

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime

If everything worked correctly you should be able to run

sublime new.js

and get sublime to open or create a new file with that name.

I used these articles by Martin Buberl and iamsid guide me through:

--

--

davefogo
The Journey: Learning to Code One Day at A Time.

I’m a software developer focused on building applications with Python and Javascript.