Remove $PATH Duplicates


I try to use Homebrew to manage my installations where possible. Homebrew ostensibly manages your $PATH variable. I rather foolishily had been ensuring my Python 3 installation was at the front of my path to ensure it’s use over the macOS included version. This meant I had a duplicate in my path.

A quick google led me to this post. In zsh you can simply:

typeset -U path

When you next echo $PATH you will find all duplicates removed.