one simple way to add system variables to OSx is to include them in .zshrc file from your home ~
and in there the new variable and also include it into $PATH
eg: with JAVA_HOME
The hosts file in a computer represents a simple plain text file, where are mapped hostnames to IP addresses (wiki).
To edit this file on Mac OS X is a very simple task:
- Open the Terminal.app
(using Spotlight : command + space – and then write terminal)
- Edit the file /private/etc/hosts
(you can use vim or nano …. ex: sudo nano /private/etc/hosts)
- Add the new map:
add at the end the new map you want : ex: 127.0.0.1 new.address.com
- Save the hosts file
save the file with the new map
If you want that your change to take place immediately, run the following command:
Now you can test the new mapping.