# How to add a new entry to the PATH variable in ZSH on Mac OS in Linux

LinuxOperating SystemOpen Source

#### TCP/IP Socket Programming HandsOn-Windows & Linux in C & C++

29 Lectures 9 hours

By default, we don’t have the .zshrc file present in macOS Catalina, and we need to create it. In order to create the .zshrc file, we can follow the steps shown below −

• Open Terminal

• Type touch ~/.zshrc to create the file.

• Hit Return

We can also open the .zshrc file in the terminal from any directory by just typing the command shown below

## Example

vi ~/.zshrc

## Output

immukul@192 linux-questions-code % cat ~/.zshrc
export GOPATH=/Users/immukul/go_projects
export GOTRACEBACK=all
export GOROOT=/usr/local/go
export LC_CTYPE=C
export PATH=/home/Systems
export LANG=C

It should be noted that the output may vary from machine to machine.

To add an entry to the PATH variable present inside the we can write the following command to the terminal, and we don’t even have to open the zshrc file to do that.

## Output

immukul@192 linux-questions-code % cat ~/.zshrc
export GOPATH=/Users/immukul/go_projects
export LANG=C