Terminal GuideTerminal Guide
broot icon

broot

File Managers
macOSLinuxWindows
Rust

Tree view file manager with fuzzy search.

Official Website

Features

Tree ViewFuzzy SearchPreviewGit Integration

Installation

Homebrew
brew install broot
Pacman (Arch)
pacman -S broot
Cargo (Rust)
cargo install broot

Why use broot?

Smart Tree Display

Display directory structure in collapsible tree. Navigate huge directories efficiently, easily understand structure.

Fuzzy Search

Real-time filtering as you type. Search not just filenames but also file contents.

Git Integration

Display Git changes in tree. Easily identify modified files and hide .gitignore files.

Custom Verbs

Define any command as verbs. Freely customize file operations, Git actions, and external tool integration.

Installation

Installation Commands
# Homebrew (macOS/Linux)
brew install broot

# Cargo (Rust)
cargo install broot

# Pacman (Arch Linux)
sudo pacman -S broot

# APT (Debian/Ubuntu) - install via snap
sudo snap install broot

# Install shell integration on first launch
broot --install

Run broot --install on first launch to install shell integration. This enables the br command.

Screen Layout

broot uses hierarchical tree display. Filter and run commands from the input field at the bottom.

┌─ broot ~/projects/terminal-guide ──────────────────────────────┐
│                                                                │
│ /Users/user/projects/terminal-guide                            │
│ ├── .git/                                    [git]            │
│ ├── node_modules/                            hidden            │
│ ├── public/                                                    │
│ ├── src/                                                       │
│ │   ├── app/                                                  │
│ │   ├── components/                                           │
│ │   │   ├── content/                                         │
│ │   │   ├── layout/                                          │
│ │   │   └── ui/                                              │
│ │   └── lib/                                                 │
│ ├── package.json                    15KB  2024-01-20 14:30    │
│ ├── tsconfig.json                    2KB  2024-01-15 09:00    │
│ └── README.md                        8KB  2024-01-18 16:45    │
│                                                                │
├────────────────────────────────────────────────────────────────┤
│ /f Filter  /c:Content search  :cd Change dir                │
│ > _                                                            │
└────────────────────────────────────────────────────────────────┘

Basic Operations

KeyAction
↑ / ↓Move selection up/down
← / →Collapse/expand tree
EnterEnter directory / Open file
Alt+Entercd to selected directory and exit
TabOpen/switch second panel
EscClear filter / Exit
Ctrl+QQuit
?Show help

Search & Filtering

broot's greatest feature is powerful search and filtering. Just type in the input field to filter instantly.

PatternDescription
fooFuzzy search paths containing "foo"
/fooSearch with regex
c/patternSearch file content
ext:jsFilter by extension
size>1MFilter by size (1MB or larger)
date>2024-01Filter by date

File Operations

File operations are executed by typing : followed by a command (verb).

CommandAction
:e or :editOpen in editor
:cdChange to selected directory and exit
:cpCopy (when using 2 panels)
:mvMove (when using 2 panels)
:rmDelete
:mkdir nameCreate directory
:create nameCreate file
:print_pathPrint path and exit

Configuration & Customization

Configuration file is ~/.config/broot/conf.hjson (or conf.toml).

~/.config/broot/conf.hjson
# ~/.config/broot/conf.hjson or ~/.config/broot/conf.toml

{
    # Default flags (show hidden files, show Git info, etc.)
    default_flags: "gh"

    # Mode settings
    modal: false

    # Date format
    date_time_format: "%Y/%m/%d %H:%M"

    # Special path settings
    special_paths: {
        "~/.config": { show: true }
        "node_modules": { show: never }
        ".git": { show: never }
    }

    # File size display
    show_selection_mark: true
    show_matching_characters_on_path_searches: true

    # Color settings
    syntax_theme: "MochaDark"
}

# Keybindings (verbs)
[[verbs]]
invocation = "edit"
shortcut = "e"
key = "enter"
apply_to = "file"
execution = "$EDITOR {file}"

[[verbs]]
invocation = "create {subpath}"
shortcut = "c"
execution = "touch {directory}/{subpath}"

[[verbs]]
invocation = "mkdir {subpath}"
shortcut = "md"
execution = "mkdir -p {directory}/{subpath}"

Defining Custom Verbs

Define custom commands (verbs) to extend functionality.

~/.config/broot/conf.hjson
# ~/.config/broot/conf.hjson - Custom verbs

[[verbs]]
# Show git diff
invocation = "gd"
execution = "git diff {file}"
leave_broot = false

[[verbs]]
# Search with ripgrep
invocation = "rg {args}"
execution = "rg {args}"

[[verbs]]
# Copy (to other panel)
invocation = "cp"
key = "ctrl-c"
execution = "cp -r {file} {other-panel-directory}"

[[verbs]]
# Move (to other panel)
invocation = "mv"
key = "ctrl-x"
execution = "mv {file} {other-panel-directory}"

[[verbs]]
# Move to trash
invocation = "trash"
key = "ctrl-d"
execution = "trash {file}"
leave_broot = false

Shell Integration

Using the br command preserves the directory when exiting.

~/.bashrc or ~/.zshrc
# ~/.bashrc or ~/.zshrc

# broot shell integration (auto-generated by broot --install)
source ~/.config/broot/launcher/bash/br

# When launching broot with the br command,
# the directory is preserved on exit

# Custom alias
alias tree='br -sdp'  # Use as directory tree

Display Flags

Press Space to toggle display options.

Common Flags

  • g - Show Git info
  • h - Show hidden files
  • i - Apply .gitignore
  • d - Show date
  • s - Show size
  • p - Show permissions

Startup Flags

Use br -gh to launch with Git info and hidden files displayed. Change defaults with the default_flags setting.

Tips

Two-Panel Mode

Press Tab to open a second panel for intuitive file copy/move. Use Ctrl+Left/Right to move files between panels.

Disk Usage Check

Use :total_size to calculate directory total size. Use :sort_by_size to sort by size.

Staging (Multiple Selection)

Press Ctrl+G to add files to the stage. Stage multiple files for batch operations.

Preview

Press Ctrl+P to open the preview panel. View text file contents on the spot.

Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More