Skip to main content
181 votes

Why does my brew installation not work?

I had the same problem—installed brew, used it, but now it doens't work, ie, brew command not recognized anymore. The context of my brew-not-recognized-anymore problem is a bit more specific: I'm ...
Matt S's user avatar
  • 1,919
111 votes

Why does my brew installation not work?

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" This code works for me on a MacBook Pro M1. PS: If you are using ...
hriday's user avatar
  • 1,219
20 votes
Accepted

What are the downsides of putting GNU coreutills first in ${PATH}?

It will break any script which expects BSD-style utilities (different arguments, partially different functionality) But you can install coreutils with Homebrew or Macports which will give them a g ...
nohillside's user avatar
  • 102k
20 votes

What are the downsides of putting GNU coreutills first in ${PATH}?

While using un-prefixed coreutils has the potential to break any script expecting BSD-style programs, I have been using un-prefixed coreutils for almost 8 years now, and I've never run into a single ...
whereswalden's user avatar
19 votes
Accepted

Homebrew PATH set in .zshenv is overridden

After ~/.zshenv is sourced, the next file that is loaded is /etc/zprofile, which is provided by macOS. This script executes eval `/usr/libexec/path_helper -s` The manual for path_helper explains: ...
rgov's user avatar
  • 589
16 votes

Why does my brew installation not work?

If your shell is zsh and your Mac is M1-based, enter these two commands after installing brew: echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile eval "$(/opt/...
Chirag Awale's user avatar
16 votes

Where is my .bash_profile located? (Mac OS 10.10.5)

Navigate to your user folder in Finder: /Users/username/ Make hidden files visible (the shortcut is ShiftCmd.) Right click .bash_profile and Open With... your text editor of choice. ShiftCmd. one ...
Mentalist's user avatar
  • 1,112
16 votes
Accepted

Problem with displaying file path in Finder's Get Info -> Where

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 ...
Steven Peters's user avatar
15 votes

I broke my PATH by editing my ~/.bash_profile and Bash will not recognize most commands

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 ...
dan's user avatar
  • 12.3k
14 votes

Why does my brew installation not work?

the -bash: brew: command not found error means that it didn't find the brew environment variable on your Mac. The correct environment configuration in .bash_profile file should be like this: export ...
Alan Keene's user avatar
14 votes
Accepted

I downloaded a shell executable and man pages from a source I trust. Where should I put them?

The binary file goes in /usr/local/bin. Each man page goes in the folder usr/local/share/man/manN where N is the number at the end of the man page file name. For example, gdisk.8 should appear in the ...
David Anderson's user avatar
13 votes
Accepted

How to get an application executable path from Terminal

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 ...
jaume's user avatar
  • 15.1k
12 votes
Accepted

Where is my .bash_profile located? (Mac OS 10.10.5)

You can edit bash profile with vi ~/.bash_profile make sure the PATH was not added in ~/.bashrc or to /etc/profile To remove the PATH you can either remove it from the file where it was added, or ...
sebastienvg's user avatar
12 votes

Problem with displaying file path in Finder's Get Info -> Where

Right Click on Folder/File Hold down the Option key Select Copy "[filename]" as pathname Paste to wherever you need it
Bugnutt Web TakeCare's user avatar
12 votes
Accepted

"which" command doesn't work / path of Safari?

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 ...
grg's user avatar
  • 202k
11 votes
Accepted

Where should I place local executables on macOS?

Homebrew doesn't directly install packages to the normal locations in /usr/local/, it installs to its own directory (/usr/local/Cellar by default) and then symlinks the files to /usr/local/bin (or lib,...
mattficke's user avatar
  • 226
11 votes
Accepted

What is xcrun and why would updating to macOS Mojave cause it to go missing?

xcrun is a tool that helps managing Xcode versions on your system. It allows you to write scripts that don't need to know where your Xcode instance or developer tools are installed. The path to the ...
DarkDust's user avatar
  • 3,185
11 votes

Invalid entries in $PATH after upgrading to macOS Ventura 13.3 [com.apple.security.cryptexd]

Cryptexes are used to update parts of macOS quickly, without requiring a full rebuild of the SSV (see https://eclecticlight.co/2023/04/05/how-cryptexes-are-changing-macos-ventura/ for details). I don'...
nohillside's user avatar
  • 102k
11 votes

Did this command do anything to my Operating System?

No damage with what's pasted to your system. It simply said "hello" by echoing some content to the window. Even if you ran the export - you can fix that by ending the shell and opening a new ...
bmike's user avatar
  • 237k
10 votes
Accepted

Set PATH variable so that it is detected in all applications, even outside terminal. (El Captain)

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 ...
fd0's user avatar
  • 10.8k
10 votes
Accepted

How to know where file is going to be saved?

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 ...
Yoan's user avatar
  • 1,297
10 votes
Accepted

Saving a filename with a special character in Mac?

Unicode U+002F is equivalent to ASCII 47, or the "slash"/soldus key on your keyboard. Calling it a Unicode special character is a bit like maître Pathelin in the medieval farce discovering ...
Daniel's user avatar
  • 34.9k
9 votes

Get AppleScript Path of Parent Folder

Try this: Unix style: set my_POSIX_path to POSIX path of ((path to me as text) & "::") If you need to pass it to e.g. shell script, you might want to enclose the path with quotes: set ...
Maciek Rek's user avatar
9 votes

How do I change the location of macOS screen captures?

As of macOS 10.14+, you don't need any specific software or scripts. The default screenshot location can be changed in the Screenshot app UI: Enter Screenshot mode: Press Command+Shift+5 Press the ...
gyunter's user avatar
  • 274
8 votes

How to change path in Finder by entering the path manually?

Use Spotlight Search (which can be opened quickly with Command + Space or sometimes a dedicated key like 🔍). It has been around since Mac OSX 10.4 Tiger. Just type or paste the full path into the ...
C Perkins's user avatar
  • 181
8 votes
Accepted

How to (and should I) put a path to user-installed python ahead of system-installed python?

You can accomplish this by adding export PATH="/path/to/python:"$PATH to your ~/.zshrc (or ~/.bash_profile if you're not on Catalina). I'd like to propose an alternative and suggest pyenv, ...
bermudalocket's user avatar
8 votes
Accepted

$PATH vs. $path

The error mentioning ‘type’ refers to the data type of the variable, such as string or array. $PATH is a string, $path is an array. You cannot assign a string, whether by variable or by literal, to a ...
grg's user avatar
  • 202k
8 votes
Accepted

Command not found: /usr/local/bin/zsh

Homebrew installs programs under /usr/local on intel but under /opt/homebrew on arm. So once you've installed Homebrew's zsh, it will be at /opt/homebrew/bin/zsh. The zsh that ships with macOS is at /...
Gilles 'SO- stop being evil''s user avatar
8 votes
Accepted

zsh does not find script in PATH while bash does (echo $PATH is the same)

Don't use ~ in your PATH. It's a shell shorthand for your home directory, but it won't work in a lot of other cases. The cases where it does work properly are those where the shell expands it into the ...
Gordon Davisson's user avatar
8 votes

Apple Silicon M1 Chip - Homebrew installer installing into Intel folder

I just ran into this. Go into your applications, right mouse click your terminal app, click "Get Info", and uncheck the "Open using Rosetta" option. Then fully close your terminal,...
Alec Sanger's user avatar

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