One can inspect the list of files installed by a Homebrew formula via brew list -f <formula_name>. In this case, the output should like

> brew list -f z
/usr/local/Cellar/z/1.9/etc/profile.d/z.sh
/usr/local/Cellar/z/1.9/INSTALL_RECEIPT.json
/usr/local/Cellar/z/1.9/README
/usr/local/Cellar/z/1.9/share/man/man1/z.1

Note that in this case there's no command (and not even bin), just a z.sh. This makes sense because z is a shell tool, and have to be sourced into the shell as functions to get and set the shell environment; running as an external command simply doesn't offer deep enough integration. Therefore, you have to source z.sh into your shell, probably in .bash_profile, .bashrc, or .zshrc.

Usually, Homebrew formulae that require post-installation interactions in order to be usable will have instructions listed in caveats, which will be shown post-install, or manually retrieved via brew info <formula_name>. In this case,

> brew info z
<irrelevant info omitted>
==> Caveats
For Bash or Zsh, put something like this in your $HOME/.bashrc or $HOME/.zshrc:
  . `brew --prefix`/etc/profile.d/z.sh

Of course you should take that advise with a grain of salt, and use more modern and human-readable shell syntax:

source "$(brew --prefix)/etc/profile.d/z.sh"

Or

source /usr/local/etc/profile.d/z.sh

if you know your Homebrew installation is in /usr/local.

Answer from 4ae1e1 on Stack Exchange
🌐
Homebrew
formulae.brew.sh › formula › z
Homebrew Formulae: z
Bottle (binary package) installation support provided.
Top answer
1 of 3
21

One can inspect the list of files installed by a Homebrew formula via brew list -f <formula_name>. In this case, the output should like

> brew list -f z
/usr/local/Cellar/z/1.9/etc/profile.d/z.sh
/usr/local/Cellar/z/1.9/INSTALL_RECEIPT.json
/usr/local/Cellar/z/1.9/README
/usr/local/Cellar/z/1.9/share/man/man1/z.1

Note that in this case there's no command (and not even bin), just a z.sh. This makes sense because z is a shell tool, and have to be sourced into the shell as functions to get and set the shell environment; running as an external command simply doesn't offer deep enough integration. Therefore, you have to source z.sh into your shell, probably in .bash_profile, .bashrc, or .zshrc.

Usually, Homebrew formulae that require post-installation interactions in order to be usable will have instructions listed in caveats, which will be shown post-install, or manually retrieved via brew info <formula_name>. In this case,

> brew info z
<irrelevant info omitted>
==> Caveats
For Bash or Zsh, put something like this in your $HOME/.bashrc or $HOME/.zshrc:
  . `brew --prefix`/etc/profile.d/z.sh

Of course you should take that advise with a grain of salt, and use more modern and human-readable shell syntax:

source "$(brew --prefix)/etc/profile.d/z.sh"

Or

source /usr/local/etc/profile.d/z.sh

if you know your Homebrew installation is in /usr/local.

2 of 3
4

in Mac osx with iterm2 with zsh just put:

First:

vim ~/.zshrc

and add this line (or just add z)

plugins=(
    git
    z
)

exit with

:x!

that's it.

🌐
Mac App Store
macappstore.org › home › install z on mac osx
Install z on Mac OSX - Mac App Store
June 12, 2022 - Mind you, as you type your password, ... echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile · Copy and paste the following command: brew install z...
🌐
GitHub
gist.github.com › derhuerst › 12a1558a4b408b3b2b6e
Installing the Z Shell (zsh) on Linux, Mac OS X and Windows · GitHub
... # Install homebrew $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # Install zsh $ brew install zsh # (optional) set default shell $ chsh -s /bin/zsh # Verify, open new terminal $ echo $SHELL
🌐
DEV Community
dev.to › palle › comment › fg7
brew install z Then add . `brew --prefix`/etc/profile.d/z.sh To y... - DEV Community
brew install z · Then add · . `brew --prefix`/etc/profile.d/z.sh · To your .zshrc file. That's it. I used this blog post to turbocharge my terminal. (The post recommends iTerm over the classic Terminal but everything works as expected in ...
🌐
GitHub
github.com › ohmyzsh › ohmyzsh › wiki › Installing-ZSH
Installing ZSH
brew install zsh · To set zsh as your default shell, execute the following assuming a default install of Homebrew · Recent macOS versions: For m1 macs: chsh -s $(which zsh) For intel macs: chsh -s /usr/local/bin/zsh · macOS High Sierra and ...
Author   ohmyzsh
🌐
GitHub
gist.github.com › mischah › 8149239
Installing und initializing z (https://github.com/rupa/z) with help of Homebrew. · GitHub
January 30, 2018 - You need Homebrew to install und init z in the way it is described in this gist: ... # Move next only if `homebrew` is installed if command -v brew >/dev/null 2>&1; then # Load rupa's z if installed [ -f $(brew --prefix)/etc/profile.d/z.sh ] && source $(brew --prefix)/etc/profile.d/z.sh fi
Find elsewhere
🌐
Homebrew
brew.sh
Homebrew: The Package Manager for Everywhere
Homebrew installs the command-line tools and applications you need across macOS, Linux and WSL.
🌐
Medium
rutger-t.medium.com › installing-zsh-and-oh-my-zsh-on-mac-using-homebrew-af80d266515d
Installing Zsh and Oh My Zsh on Mac using Homebrew | by Rutger | Medium
July 9, 2024 - From macOS Catalina Zsh, Zsh became the default login shell and interactive shell, so if you are using macOS Catalina or above, you can skip this step of installing Zsh and setting Homebrew’s Zsh as the default. First, install Zsh using homebrew. ...
🌐
Homebrew
docs.brew.sh › Installation
Homebrew Documentation: Installation
The script installs Homebrew to its default, supported, best prefix (/opt/homebrew for Apple Silicon, /usr/local for macOS Intel and /home/linuxbrew/.linuxbrew for Linux) so that you don’t need sudo after Homebrew’s initial installation when you brew install.
🌐
Homebrew
formulae.brew.sh › formula › zsh
Homebrew Formulae: zsh
brew install zsh · UNIX shell (command interpreter) https://www.zsh.org/ License: MIT-Modern-Variant AND GPL-2.0-only AND GPL-2.0-or-later AND ISC · Development: Pull requests · Formula JSON API: /api/formula/zsh.json · Formula code: zsh.rb ...
🌐
Wordpress
makingdeveloperslivesbetter.wordpress.com › 2020 › 01 › 03 › zbrew-easy-z-os-install-config
zbrew: Easy Software install/config on z/OS – Making Developers' Lives Better
January 3, 2020 - For the COBOL compiler, I needed to write the prereq script to check that the system was at least z/OS 2.2 and that specific LE PTFs had been applied. I needed to write the install script to allocate datasets to be used and to allocate a zFS file system, mount it, and create some directories in the file system. I used a variety of tools from the IBM Z Open Automation Utilities for this. On a Mac, installation and configuration might be lumped into one step.
🌐
Sourabh Bajaj
sourabhbajaj.com › mac-setup › iTerm › zsh.html
Zsh · macOS Setup Guide
The installation script should set zsh to your default shell, but if it doesn't you can do it manually:
🌐
Mac Install Guide
mac.install.guide › homebrew › 3
Install Homebrew on Mac · 2026 · Step by Step
1 month ago - Mac install brew: How to install Homebrew on Mac. Download Homebrew and install on macOS from the terminal.
🌐
Mac Install Guide
mac.install.guide › homebrew › zsh-command-not-found-brew
'zsh: command not found: brew' · Mac Install Guide
You are trying to run Homebrew in the Mac Terminal. Homebrew is used for installing command line software. The Terminal interprets commands using the Zsh shell. The error messages shows that the Zsh shell cannot find Homebrew's brew command.
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-install-and-use-homebrew-on-macos
How To Install and Use Homebrew on macOS | DigitalOcean
April 15, 2026 - For Zsh, which is the default shell on modern macOS, this file is ~/.zshrc. ... Add the correct line for your system at the end of the file. ... Save the file (CTRL+O, Enter) and exit nano (CTRL+X). Then, apply the changes to your current terminal session: ... The command you installed should now work correctly. Sometimes, brew install fails midway through the process.
🌐
GitHub
gist.github.com › nilshartmann › 25ef96d56650994f6a7adab42f9bdead
install-brew.zsh · GitHub
Download ZIP · Raw · install-brew.zsh · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters ·
🌐
freeCodeCamp
freecodecamp.org › news › how-to-configure-your-macos-terminal-with-zsh-like-a-pro-c0ab3f3c1156
How to Configure your macOs Terminal with Zsh like a Pro
November 15, 2018 - By default, macOs ships with zsh located in/bin/zsh. Let’s install zsh using brew and make iTerm2 use it.