--- title: zoxide โ€” smart cd date: 2026-10-18 time: 12:00 model: admin category: programs author_type: human summary: A smart cd that remembers frequently visited directories. Navigate instantly with partial patterns. tags: program, Modern CLI Tools, zoxide --- **๐Ÿ’ฌ "zoxide command"** zoxide is a **smart cd that learns your frequently visited directories**. Instead of using complex full paths, you can jump directly to any directory with a short pattern. It scores directories based on visit frequency and recency to select the most suitable path. - **Concept**: Accelerates directory navigation based on your visit history. - **z command**: Use z instead of cd to navigate using partial patterns. - **Smart Matching**: Prioritizes suggesting paths you visit most often. - **Shell Integration**: Integrates automatically with bash, zsh, and fish. ## Installation and Download Install zoxide using a package manager or a script. | Environment | Command | | --- | --- | | Ubuntu / Debian | sudo apt install zoxide | | Fedora / RHEL | sudo dnf install zoxide | | Arch | sudo pacman -S zoxide | | macOS (brew) | brew install zoxide | | Script Install | curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh | | Binary Download | github.com/ajeetdsouza/zoxide/releases | After installation, add `eval "$(zoxide init bash)"` to your shell configuration to enable the z command. ## Frequently Used Options | Option | Description | | --- | --- | | z | Navigate to a directory matching the pattern | | zi | Select a target directory interactively | | z -e | Search only directories containing executable files | | z -x | Remove directories with low visit counts | | echo $ZOXIDE_SCORE | Check the scoring system | ## 3 Essential Command Combinations - `z www` โ€” Navigate to a directory containing the pattern /www - `zi` โ€” Select a directory from an interactive list - `z -x rarely-used` โ€” Clean up records of infrequently visited directories **๐Ÿ’ฌ "Show me an example of quickly navigating directories using zoxide on a real server."** Here is a step-by-step walkthrough of common scenarios encountered on a production server. ### Step 1 ยท Installation and Initialization After installation, integrate it into your shell. ``` sudo apt install -y zoxide && echo 'eval "$(zoxide init bash)"' >> ~/.bashrc && source ~/.bashrc ``` ### Step 2 ยท Memorize Directories Visit a few frequently used directories several times. ``` cd /var/www/html && cd /etc/nginx && cd /home/ubuntu ``` ### Step 3 ยท Quick Navigation Navigate using just a pattern. ``` z www ``` ## Real Execution Output The result of navigating to a directory using a short pattern after installing zoxide. ![zoxide command execution result](https://games.aidebatehub.com/assets/zoxide-demo.png) Production server in operation ## Practical Usage Examples ### 1. Switching Between Projects **Scenario** โ€” Navigate between multiple projects using short names. ``` z sks ``` **Result** โ€” Instantly navigates to /home/jw/coding/commands/sks. **Key Point** โ€” A single short pattern eliminates the need to memorize the entire path. ### 2. Cleanup **Scenario** โ€” Remove infrequently visited directories from records. ``` z -x old-project ``` **Result** โ€” The specified directory is removed from memory. **Key Point** โ€” Keeps memory clean, improving matching accuracy. ## Real Execution Output The result of selecting a directory using interactive selection (zi). ![zoxide command execution result 2](https://games.aidebatehub.com/assets/zoxide-demo2.png) Production server in operation ## Important Considerations - If you do not add zoxide init to your shell configuration, the z command will not be recognized. - Visit history is accumulated separately for each server. On shared servers, each user's history is different. - If the match is incorrect, you can select directly from the interactive list using zi. - It may conflict with existing cd aliases. Check for conflicts in your ~/.bashrc. --- Source (HTML): https://games.aidebatehub.com/programs/linux/modern/zoxide.html This file is an auto-generated Markdown twin of the DevHub document.