z.lua for Mac
A command line tool which helps you navigate faster by learning your habits :zap:
z.lua — overview
A command line tool which helps you navigate faster by learning your habits :zap:
An alternative to z.sh with windows and posix shells support and various improvements.
【README in Chinese | 中文文档】
Description
z.lua is a faster way to navigate your filesystem. It tracks your most used directories, based on 'frecency'. After a short learning phase, z will take you to the most 'frecent' directory that matches ALL of the regexes given on the command line, in order.
For example, z foo bar would match /foo/bar but not /bar/foo.
Reputation
From people using z.lua: I like this in principal. I’m pretty damn predictable at the command line and far too lazy to make shortcuts It feels far more intuitive and it's so incredibly convenient to be able to jump between folders I'm working in without having to traverse an entire tree. The shell used to feel so constraining for me, but tools like this are making me enjoy it so much more. I can finally have autojump-like functionality on my Raspberry Pi 1 without waiting 30 seconds every time I open a new shell. Thanks z.lua devs. Anyway, z.lua is a promising project. If you only need directory jumping, it may be the best choice.
Features 10x times faster than fasd and autojump, 3x times faster than z.sh. Gain the ultimate speed with an optional native module written in C. Available for posix shells: bash, zsh, dash, sh, ash, ksh, busybox and etc. Available for Fish Shell, Nushell, Power Shell and Windows cmd. Enhanced matching algorithm takes you to where ever you want precisely. Allow updating database only if $PWD changed with "$_ZL_ADD_ONCE" set to 1. Interactive selection enables you to choose where to go before cd. Integrated with FZF (optional) for interactive selection and completion. Quickly go back to a parent directory instead of typing "cd ../../..". Corresponding experience in different shells and operating systems. Compatible with Lua (5.1, 5.2, 5.3+) and luajit. Self contained, distributed as a single z.lua script, no other dependence.
Examples
Install Bash:
put something like this in your .bashrc:
eval "$(lua /path/to/z.lua --init bash)"
the default matching algorithm is similar to z.sh to keep compatible, you may like the enhanced matching algorithm for productivity:
eval "$(lua /path/to/z.lua --init bash enhanced once)"
and perhaps this:
eval "$(lua /path/to/z.lua --init bash enhanced once echo)"
if you want z.lua print the new directory after cd.
For fzf tab completion use:
eval "$(lua /path/to/z.lua --init bash enhanced once fzf)"
NixOS users using home-manager can add this to their user profile:
programs.z-lua.enable = true; programs.z-lua.enableBashIntegration = true; programs.z-lua.options = [ "enhanced" "once" "fzf" ]; # modify as needed
NOTE: For wsl-1 users, lua-filesystem must be installed:
sudo apt-get install lua-filesystem
To avoid a wsl-1 defect. Zsh:
put something like this in your .zshrc:
eval "$(lua /path/to/z.lua --init zsh)"
Details
新的 cd 命令,通过学习你的习惯来帮助你更快地导航
How to install z.lua
- Open Terminal (press ⌘ + Space and type “Terminal”).
- If Homebrew is not installed yet, run the command below first.
- Run this command:
Latest 10 releases
Last updated 2026-10-28; current version 1.8.27, with the latest 10 releases listed.
| Version | Released | Type | Size | macOS | Windows | Linux |
|---|---|---|---|---|---|---|
| 1.8.27 | 2026-10-28 | Stable | — | — | — | — |
| 1.8.26 | 2026-08-10 | Stable | — | — | — | — |
| v1.8.25 | 2026-03-09 | Stable | — | — | — | — |
| 1.8.24 | 2025-05-24 | Stable | — | — | — | — |
| 1.8.23 | 2025-05-17 | Stable | — | — | — | — |
| 1.8.22 | 2025-05-17 | Stable | — | — | — | — |
| 1.8.21 | 2025-05-15 | Stable | — | — | — | — |
| 1.8.20 | 2024-10-18 | Stable | — | — | — | — |
| 1.8.19 | 2024-10-11 | Stable | — | — | — | — |
| 1.8.18 | 2024-03-20 | Stable | — | — | — | — |
Data from GitHub Releases; stable releases first, each group sorted newest first.
Compared with similar apps
Only public metadata is compared, with no subjective recommendation; see the compare pages for field-by-field comparisons.
| App | Version | License | Architecture | 30-day installs |
|---|---|---|---|---|
| z.lua | 1.8.27 | MIT | CLI | 38 |
| nmh | 1.8 | BSD-3-Clause | CLI | 15 |
| raxml-ng | 2.0.4 | AGPL-3.0-or-later | CLI | 11 |
| fcp | v0.2.2 | BSD-3-Clause | CLI | 12 |
Similar apps: Command-line Tools
nmh
nmh is a new version of the classic MH mail handling program, aimed at users who are accustomed…raxml-ng
RAxML Next Generation: faster, easier-to-use and more flexiblefcp
fcp is a significantly faster alternative to the classic Unix cp(1) command.betterglobekey
betterglobekey Make macOS Globe key great again! Ask a Question • Report a Bug • Request a…openssl@4
Cryptography and SSL/TLS Toolkitxz
General-purpose data compression with high compression ratioCategories: Command-line Tools