
- Kali Linux Tutorial
- Kali Linux - Home
- Installation & Configuration
- Information Gathering Tools
- Vulnerability Analyses Tools
- Kali Linux - Wireless Attacks
- Website Penetration Testing
- Kali Linux - Exploitation Tools
- Kali Linux - Forensics Tools
- Kali Linux - Social Engineering
- Kali Linux - Stressing Tools
- Kali Linux - Sniffing & Spoofing
- Kali Linux - Password Cracking Tools
- Kali Linux - Maintaining Access
- Kali Linux - Reverse Engineering
- Kali Linux - Reporting Tools
- Kali Linux Useful Resources
- Kali Linux - Quick Guide
- Kali Linux - Useful Resources
- Kali Linux - Discussion
How to add a new entry to the PATH variable in ZSH on Mac OS in Linux
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 NDHOME=/Users/immukul/Downloads 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.
Command
echo -n 'export PATH=~/some/path:$PATH' >> ~/.zshrc
Output
immukul@192 linux-questions-code % cat ~/.zshrc export GOPATH=/Users/immukul/go_projects export NDHOME=/Users/immukul/Downloads export GOTRACEBACK=all export GOROOT=/usr/local/go export LC_CTYPE=C export PATH=/home/Systems:/some/path export LANG=C
Another approach is to open the zshrc file and then insert the export command manually.
Command
export PATH=/home/bin:$PATH
Output
immukul@192 linux-questions-code % cat ~/.zshrc export GOPATH=/Users/immukul/go_projects export NDHOME=/Users/immukul/Downloads export GOTRACEBACK=all export GOROOT=/usr/local/go export LC_CTYPE=C export PATH=/home/Systems:/some/path:/home/bin export LANG=C
It is recommended to source the file once you are done to make the changes available to all the terminals.
- Related Articles
- How to set Java Path in Mac OS?
- How to set Java Path in Linux OS?
- Recommended IDEs for C# on Windows/Linux/Mac OS
- How to install Selenium WebDriver on Mac OS?
- What languages have been used to write Windows, Mac OS and Linux OS?
- How to set your python path on Mac?
- How to compile and execute C# programs on Mac OS?
- Installing Python on Mac OS
- How to set JAVA_HOME for Java in Mac OS?
- How to Format a Hard Disk on Linux OS
- How to set python environment variable PYTHONPATH on Mac?
- How to Add a New Disk Drive to a Linux Machine
- How to connect a variable to the Tkinter Entry widget?
- How to add a user to the group on linux
- How to set your python path on Linux?
