Path management


Two variables represent the same list of folders but in different formats. The variable $PATH is a string and the variable $path is an array.

Altering the path array

# Append

# Prepend
path=(my/new/path $path)


To avoid duplicate entries caused by the append method, use typeset -U to keep only the first occurrence of each duplicated value. Check the Zsh command documentation.

typeset -U PATH path