182
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 ...
112
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 ...
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 ...
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 ...
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:
...
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/...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
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♦
- 204k
12
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,...
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 ...
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'...
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 ...
10
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 ...
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 ...
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 ...
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 ...
9
votes
OpenVPN Connect profile path
Normally they should show up in
~/Library/Application Support/OpenVPN Connect/profiles
where ~ is your home folder
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 ...
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, ...
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♦
- 204k
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 /...
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 ...
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,...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
path × 337macos × 149
terminal × 128
bash × 84
command-line × 61
homebrew × 37
finder × 35
zsh × 25
applescript × 20
python × 20
environment-variables × 14
automator × 9
iterm × 9
macbook-pro × 8
applications × 8
mac × 7
launchd × 7
file × 7
install × 6
symlink × 6
unix × 5
script × 5
git × 5
xcode × 4
permission × 4