Adding/removing items from PATH on Mac
In Flash Mobile Application Development for Dummies, I said that adding a new path variable on your Mac was a little beyond the scope of the book. That said, I wanted to put the knowledge somewhere so that those looking for further reading on the subject are able to accomplish this task.
Let's assume you have some executables in the directory /users/yourname/myfolder/ and want them to be available at the Terminal prompt, without having to type the full path to them each time. Here's how to make them available on your PATH variable:
1. Open Terminal (Applications->Utilities->Terminal).
2. Paste the following into the Terminal window.
sudo pico /etc/paths
3. Press the Return key.
4. Enter your logon password and press the Return key.
The Terminal window presents the contents of the paths file, with each path entry listed on a new line.
5. Put the cursor on the empty line below the last entry and type the new directory path that you want to add. For example:
6. Press Ctrl+O (to save).
7. At the File Name to Write prompt, just press the Return key.
The message "[Wrote x lines]" displays.
8. Press Ctrl+X (to exit the editor).
Terminal then returns to the prompt screen and the update is complete. To verify that the new path has been correctly saved:
1. Press Cmd+Q (to quit Terminal).
2. Reopen Terminal.
3. Paste, or type, the following into the Terminal window:
4. Press Return.
The list of paths that are stored in the paths file are listed. If you did everything right, path should be in the list.
- Mac OS find files using regex
- ADB device driver won't install
- Eclipse: An error has occurred. See the log file .metadata/.log
- Updated blinkbox iPad app
- Nexus 7 doesn't appear in adb devices list
- Improve the keyboard in the Samsung ICS update
- 403 Forbidden error on Mac web server
- Getting error with manually created NIB?
- Presenting at Flash Oxford
- Failed to get the task for process xx
Places you'll find me:
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016