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
brew install z · Tracks most-used directories to make cd smarter · https://github.com/rupa/z · License: WTFPL · Development: Pull requests · Formula JSON API: /api/formula/z.json · Formula code: z.rb on GitHub · Bottle (binary package) ...
🌐
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 Terminal) For further actions, you may consider blocking this person and/or reporting abuse ·
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 - Now, copy/paste and run this command to make brew command available inside the Terminal: echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile · Copy and paste the following command: brew install z
🌐
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 on GitHub ·
🌐
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
Find elsewhere
🌐
GitHub
github.com › Linuxbrew › legacy-linuxbrew › issues › 1083
z command not found after brew install · Issue #1083 · Linuxbrew/legacy-linuxbrew
April 20, 2016 - $ brew install z ==> Downloading https://github.com/rupa/z/archive/v1.9.tar.gz Already downloaded: /home/vagrant/.cache/Homebrew/z-1.9.tar.gz ==> Caveats For Bash or Zsh, put something like this in your $HOME/.bashrc or $HOME/.zshrc: . `...
Author   Linuxbrew
🌐
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 - First, install Zsh using homebrew. brew update brew install zsh · Open the file by using the below command. sudo vi /etc/shells · add /usr/local/bin/zsh to the list. # List of acceptable shells for chpass(1). # Ftpd will not allow users to ...
🌐
GitHub
github.com › ohmyzsh › ohmyzsh › wiki › Installing-ZSH
Installing ZSH
Try zsh --version before installing it from Homebrew. Preferably newer than or equal to 5.0.8. 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 ·
Author   ohmyzsh
🌐
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 - How about Linux? To install git on my Mac, I type: brew install git Easy stuff is easy on a Mac... Unfortunately, it isn't that easy on z/OS. z/OS is a multi-tenant system used by lots of people, so of course it won't be quite…
🌐
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:
🌐
Homebrew
formulae.brew.sh › formula › zbar
Homebrew Formulae: zbar
brew install zbar · Suite of barcodes-reading tools · https://linuxtv.org/downloads/zbar/ License: LGPL-2.1-only · Development: Pull requests · Formula JSON API: /api/formula/zbar.json · Formula code: zbar.rb on GitHub · Bottle (binary package) installation support provided for: Current versions: Revision: 2 ·
🌐
Homebrew
formulae.brew.sh › formula › zsh-completions
Homebrew Formulae: zsh-completions
brew install zsh-completions · Also known as: zsh-completion · Additional completion definitions for zsh · https://github.com/zsh-users/zsh-completions · License: MIT-Modern-Variant AND BSD-3-Clause AND MIT AND Apache-2.0 AND ISC AND NCSA · Development: Pull requests ·
🌐
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 ·
🌐
Homebrew
formulae.brew.sh › formula › z.lua
Homebrew Formulae: z.lua
brew install z.lua · New cd command that helps you navigate faster by learning your habits · https://github.com/skywind3000/z.lua · License: MIT · Development: Pull requests · Formula JSON API: /api/formula/z.lua.json · Formula code: z.lua.rb ...
🌐
Homebrew
formulae.brew.sh › cask › cuda-z
cuda-z — Homebrew Formulae
brew install --cask cuda-z · Name: CUDA-Z · Show basic information about CUDA-enabled GPUs and GPGPUs · https://cuda-z.sourceforge.net/ Development: Pull requests · Cask JSON API: /api/cask/cuda-z.json · Cask code: cuda-z.rb on GitHub · ...