WEBTOOLIST.
STATIC WEB PLATFORM
NO ACCOUNTS / NOTHING TO INSTALL

$ webtoolist --script fuzzy-find-helper

Fuzzy Find Helper

Search filenames interactively with fzf when available, falling back to find.

category Shell Productivity shell Bash 4+ updated 2026-09-17
fzffindshellproductivity
Safety notes
  • Read-only: lists and opens a selected path.
  • Falls back to printing matches when fzf is not installed.

Dependencies: fzf (optional), find

Usage

  • Pass a search root (default: current directory).
  • The selected path is printed; pipe it into your editor.

Script

#!/usr/bin/env bash
set -euo pipefail

root="${1:-.}"
[[ -d "$root" ]] || { echo "not a directory: $root" >&2; exit 1; }

if command -v fzf >/dev/null; then
  find "$root" -type f -not -path '*/.git/*' -print 2>/dev/null \
    | fzf --height 40% --reverse --prompt 'open> '
else
  echo "fzf not installed; showing matches instead" >&2
  find "$root" -type f -not -path '*/.git/*' -print 2>/dev/null | head -n 40
fi

Example

path=$(./fuzzy-find-helper ~/projects) && "${EDITOR:-vi}" "$path"

Notes

  • The command substitution is intentional: it captures the selected path.
  • If the user cancels fzf, the substitution is empty — guard before opening an editor.

Related scripts

Timestamped Notes

Append a timestamped note to a daily Markdown file without leaving the shell.

Shell Productivity

File Permission Audit

Find world-writable files and directories, excluding known-safe locations.

Security

Find Large Files

Locate files above a size threshold and show them largest first.

File Management

PATH Audit

Check PATH for missing, duplicate, or world-writable directories.

Linux Utilities