Hot answers tagged

191

Typing open . in Terminal will open the current working directory in a Finder window.


82

unset it unset DYLD_LIBRARY_PATH The bash reference manual says Once a variable is set, it may be unset only by using the unset builtin command.


38

Finder has a menu item found under Go ("Go to Folder…") where you can type a full path. The command+shift+G keyboard shortcut makes it handy to summon. This short cut works in the file open and save dialog as well.


38

If you are on 10.7 and not 10.8, the solution below works well: I had the same problem with eclipse, but now I've added e.g. the following to my .bash_profile and then it worked. export PATH=some_path:another_path launchctl setenv PATH $PATH In case you want to leave the original path intact use p=$(launchctl getenv PATH) launchctl setenv PATH /my/new/...


29

Yes, create a .bash_profile file in your home directory containing PATH="/usr/local/bin:$PATH" and then do one of the following to make the change active execute . ~/.bash_profile execute PATH="/usr/local/bin:$PATH" in the current shell restart Terminal


22

The simplest way is to restore from a backup e.g from Time Machine However if the last backup is long enough ago that there is other changes you want to keep the you can edit .bash_profile In terminal In a terminal you can use the full path to the editors ( /usr/bin/emacs /usr/bin/vi or /usr/bin/nano) to edit ~/.bash_profile e.g. /usr/bin/nano ~/....


19

To answer you question to your 'new' problem, I've decided to write another answer - because it is easier to explain with samples. One way to load the environment variables on startup of your tool (IDE) of choice is like it can be done with eclipse - I think there must be a similar structure in your tool (IDE) too. How it can be done in eclipse - https://...


16

On OS X 10.10 Yosemite, I used this command: sudo launchctl config user path <my path setting> Be aware that his sets the launchtl PATH for all users. This worked well for my use case. Note that you'll be asked to reboot your machine for the effects to take hold.


15

Have you started a new login shell since adding the new file for ImageMagick? The setting of the path from paths.d entries is done in /etc/profile and /etc/csh.login, so you need to start a new shell for the new entries to take effect. OS X uses path_helper to set the path based on the files in /etc/paths.d - you can always call it manually (assuming a ...


14

After many trials with different options I conclude: Is there a unified way to set the PATH for applications launched by different means (like shell script, Finder and Spotlight)? Well, yes and no: No: Setting PATH in shell start up scripts (e.g. .bashrc) works only for apps launched by shells. No: Setting PATH for the current launchd process via launchctl ...


14

You can select the file and press Option + Command + C to copy the pathname to the clipboard. https://apple.stackexchange.com/a/252179/192890 You can also use Control + Option + right click in macOS Mojave (copy as pathname will replace copy file in get info modal). Little change but I just found it. Still works on networked drives too.


13

Your command replaces the entire path variable with your path, thereby removing folders such as /bin. You need to add your path to the existing path, not replace it: export PATH=/users/ophir/android-sdks/tools:$PATH Alternatively, so that you don't replace the tools found in folders that are in your existing path, you can add your new folder to the end of ...


12

which searches for binaries in the $PATH, a.k.a. command-line tools. User applications are not such tools and not available in the command line. While Safari.app is an application, the Safari binary is not usually added to the $PATH because it is not a command line tool — if you just run Safari in Terminal your shell will inform you that the command cannot ...


11

On Mountain Lion all the /etc/paths and /etc/launchd.conf editing doesn't take any effect! Apple's Developer Forums say: "Change the Info.plist of the .app itself to contain an "LSEnvironment" dictionary with the environment variables you want. ~/.MacOSX/environment.plist is no longer supported." So I directly edited the app's Info.plist (right ...


11

Bring back a minimal PATH Enter the following command to reset a minimal PATH: PATH=/bin:/usr/bin Fix ~/.bash_profile Edit your ~/.bash_profile with your preffered text editor vi, emacs or TextEdit. Always prefer a relative PATH construct: PATH=${PATH}:...my_personal_added_pathes... export PATH Test it Before proceeding as too many beginners do by ...


11

The default content of /etc/paths until Mavericks (10.9) is: /usr/bin /bin /usr/sbin /sbin /usr/local/bin The default content of /etc/paths since Yosemite (10.10) is: /usr/local/bin /usr/bin /bin /usr/sbin /sbin


10

You need to install the Xcode command-line developer tools. Open Xcode and go to Xcode → Preferences → Downloads, select the Components tab, and click the button next to “Command Line Tools”. See Is the installation of Xcode from App Store enough for having the developer tools?.


10

You need to amend /etc/paths so that /usr/local/bin is listed before /usr/bin. You'll need to sudo your editor in order to do that. One of the ways to open editor is sudo open -t /etc/paths


10

Click on position indicated by the red arrow in the figure below: This will allow you to choose which folder/path you need. You can also use the Command - Shift - G to open the dialog to explicitly paste / type in a path. Enter a filename in the File Open dialog Save file to hidden directory with standard OS X save dialog


9

Stretch goal! To expand on the answer above (because the more appropriate related question is marked as a dupe and can't recieve new answers)... I've added a function to my ~/.bash_profile to handle revealing a file or directory: # Reveal a file or directory in Finder # ..expects only one argument # the argument is quoted to accommodate spaces in the ...


9

The Filesystem Hierarchy Standard is followed in Linux and other Unix based OSes, and OS X follows this too, to a large extent. The /private folder is where basically your OS X core resides and the /etc and /var folders are merely symbolic pointers to /private/etc and /private/var respectively. You can verify this by using readlink as readlink /etc. The /...


9

You certainly don't need to reinstall - just remove the offending last line of the file and restart terminal to see the effects. If you don't know how to edit the file from terminal, you can open the file in your system's default plain text editor: /usr/bin/open ~/.bash_profile Just delete the last line and save the file. (The >> tacks the output of the ...


9

All software in Mac OS X is installed in /Applications, which can be found in the Finder sidebar Most Mac applications don't have to be installed, you just have to copy the applications in the Applications folder. Normally, all installed applications that are in the /Applications folder appear automatically in the Launchpad. You can uninstall ...


9

Add the following to your ~/.bash_profile export PATH=/usr/local/git/bin:$PATH


9

In bash, there are two main ways to have spaces in path names: Backslash escape the spaces /path/to/folder\ with\ spaces/ Wrap with quote marks "/path/to/folder with spaces and $variable/" '/path/to/folder with spaces and a literal $/' Double quote marks expand shell variables. Single quote marks do not.


9

I would like to know if there is a command that returns the executable within the application bundle There is no such command, but I've written a shell script that does exactly that for any application bundle in the file system of your startup disk. It uses several command line tools included in macOS and leverages Apple's documentation on Launch Services, ...


8

The command line version would be: open -R /Library/Frameworks/Python.framework/Versions/ or just: open /Library/Frameworks/Python.framework/Versions/ depending on you want to go inside the folder or reveal the folder in finder.


8

With Mountain Lion /etc/launchd.conf is where you should set the GUI applications Path. Remember it's not a script file; it only supports launchctl commands so you should write something like: setenv PATH /new/path:/usr/bin:/bin:/usr/sbin:/sbin Note also that it doesn't support shell environment variable substitutions (like $PATH) so you'll have to set ...


8

The error message you listed is the result of using one of export $VARIABLE export /a/path/to/something export *more or less anything which is not a syntactically correct variable name* instead of export VARIABLE in one of your initialization files. To find the offending line you need to look into all the .profile, .bash_profile and anything sourced/...


8

The loginwindow process sets a user's environment. It sets the variables TMPDIR and PATH, consults Directory Services and sets SHELL HOME USER LOGNAME . PATH is set to /usr/bin:/bin:/usr/sbin:/sbin unless modified by launchd (in the more current versions of OS X). This is the PATH variable available to the user's processes unless modified by that particular ...


Only top voted, non community-wiki answers of a minimum length are eligible