In this article, I will demonstrate the command-line tools that I use most often. I can almost promise you that you will learn something new.
- You know how to use the command-line
- You are using Mac OS. (Not all tools exist on Windows or Linux, but the same concepts and most of the tools should still apply.)
I use iterm2 instead of the standard terminal on Mac OS. I have never really used the standard terminal app because iterm2 has a wider feature set and is much easier on the eyes (especially if you use solarized-light!)
Bonus tip: Did you know you can load and save your settings to a folder? This can be found in
Preferences -> General. I save and load from a file that is checked into version control.
- Set up oh-my-zsh with a script from https://github.com/robbyrussell/oh-my-zsh
- Choose your theme (I just use the standard one)
- Add your favourite plugins
Check out the wiki for more information.
The plugins that I use are:
- colored-man-pages: makes it easier to read
- fasd: file navigation (more on this later)
- git: git aliases
gup='git pull --rebase'
- Pressing the up-arrow key might show
cd dev, which is the last time
- Pressing the up-arrow key again might show
cd src, which is the second last time
- Pressing the down-arrow key will show
cd dev, which is the last time
tabshows a list of possible directories to change to. For example:
node_modules/ public/ src/
- Pressing tab again will allow you to navigate through the list
Homebrew can be used to install almost anything. Here are some commands I use most often:
Install almost any package with
brew install <package>
brew install node
brew install git
Install almost any application with
brew cask install <application>
brew cask install dropbox
brew cask install spotify
brew bundle dump --forcecopies all your packages and casks into a
brew bundleinstalls packages and casks from a
Bonus tip: Check the
Brewfile into version control! Next time you get a new computer all you have to do is install Homebrew and then type
Update all your packages and casks at once with
fasd can be set up as follows:
fasd has one job (for me) and that is to navigate to recently visited directories. Let's say I want to navigate to a directory I have previously visited like
~/dev/misc/terraform/terraform-serverless-example. Instead of typing out the whole path I just type
z terra ex and I'm already there!
Switching between multiple versions is not the only benefit. If you are working on a team and using Node you could check an
.nvmrc file into version control and every developer can apply the same version with
With file links you can tell your terminal where to look for certain files. For example with:
ln -s ~/dev/dotfiles/gitconfig ~/.gitconfig
you tell your terminal that your git config is actually stored at
~/dev/dotfiles/gitconfig. If you need to view or edit the file you can open the file from
Bonus tip 1: You can store all your configuration files in version control and link to them on your machine. I do this for my
Bonus tip 2: If you have different git configurations for different projects you can add the following to your
[includeIf "gitdir:~/dev/work/"] path = ~/dev/work/gitconfig
Bonus tip 3: If you don't want to check-in sensitive data (eg. environment variables) from your
.zshrc into version control you can source a local file with:
Check out 7 Awesome Rust-powered Command-line Utilities for similar tools.
Learning each of these tools has levelled up my productivity and I hope it has the same effect on you. After mastering these tools you might want to start tackling vim :D.
Before you go… Thank you for reading this far! If you enjoyed the article, please don't forget to ❤️ it.
I write about my professional and educational experiences as a self-taught software developer, so click the +FOLLOW button if this interests you! You can also check out my website or subscribe to my newsletter for more content.
You might also like: