explaingit

rupa/z

Analysis updated 2026-06-24

16,992ShellAudience · developerComplexity · 1/5Setup · easy

TLDR

Shell script that tracks the directories you visit most and lets you jump to them by typing a fragment of the path.

Mindmap

mindmap
  root((z))
    Inputs
      cd history
      Search terms
    Outputs
      Directory jump
      Frecency database
    Use Cases
      Faster cd
      Jump to recent project
      Tab complete paths
    Tech Stack
      Bash
      Zsh
      POSIX shell
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Jump back to a deeply nested project folder by typing a single word.

USE CASE 2

Replace long cd commands in daily terminal work with z foo style shortcuts.

USE CASE 3

Inspect the frecency database to see which directories you actually use.

USE CASE 4

Add z to a shared dotfiles repo so the team gets the same shortcut behavior.

What is it built with?

ShellBashZsh

How does it compare?

rupa/zleonxlnx/taste-skillsource-foundry/hack
Stars16,99217,18617,237
LanguageShellShellShell
Setup difficultyeasyeasyeasy
Complexity1/51/51/5
Audiencedevelopervibe coderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Source z.sh from your shell rc file, needs a short learning period of normal cd usage before jumps work well.

In plain English

z is a small shell utility that makes navigating your computer's file system much faster from the command line. Instead of typing full directory paths every time you want to go somewhere, z learns which folders you visit most often and lets you jump to them by typing just a part of their name. The key idea is "frecency", a combination of frequency and recency. z tracks every folder you visit and assigns each one a score based on how often and how recently you've been there. When you type z foo, it automatically changes your current directory to whichever folder best matches "foo" based on that score. If you want the most recently visited match instead, you can use z -t foo, for the highest-ranked match regardless of recency, use z -r foo. You can also combine search terms: z foo bar will match a path that contains both words in that order. After a short learning period, just using cd normally as you work, z builds up a database of your folder history. You install it by adding a single line to your shell's startup file and then just use it naturally. It works with bash and zsh. You'd use z when you find yourself constantly navigating to the same few directories and want to save keystrokes. It's a lightweight, single-file shell script with no dependencies beyond your shell itself.

Copy-paste prompts

Prompt 1
Walk me through installing z by sourcing z.sh in my .zshrc on macOS.
Prompt 2
Help me migrate from autojump to z and keep my old jump history if possible.
Prompt 3
Show me how to use z -t and z -r flags and when each one is the right choice.
Prompt 4
Help me write a wrapper around z that prints the top 10 frecency entries.
Prompt 5
Explain how z's frecency score is calculated and where the database file lives.

Frequently asked questions

What is z?

Shell script that tracks the directories you visit most and lets you jump to them by typing a fragment of the path.

What language is z written in?

Mainly Shell. The stack also includes Shell, Bash, Zsh.

How hard is z to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is z for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub rupa on gitmyhub

Verify against the repo before relying on details.