extended-grep is a wrapper around rg (ripgrep) that saves search results as HTML files in ~/search-results.
- Better handling for tricky search strings in day-to-day usage (for example:
search "fox, "). - Search results are written to HTML reports, so your terminal stays clean even for large searches.
- Optional TXT reports (
--format txt) are useful on terminal-only Linux servers.
Example:
search "fox, "This creates an HTML report in ~/search-results.
Command usage:
Search result for search fox:
Search result for search "fox, ":
- Recursive project search with profiles (
grepx,code,xml,filename, etc.) - Colorized HTML output per search for faster visual scanning
- Works on macOS, Linux, and Windows
scripts/runtime/: runtime search implementation (search.sh,search.ps1,grepfunctions.sh)scripts/install/: platform installersscripts/uninstall/: platform uninstallersscripts/tests/: smoke tests and fixtures
- ripgrep (
rg) installed and available onPATH
macOS:
brew install ripgrepWindows (PowerShell):
winget install BurntSushi.ripgrep.MSVCLinux:
# Amazon Linux / Fedora / RHEL (dnf)
sudo dnf install -y ripgrep
# Ubuntu / Debian (apt)
sudo apt-get update && sudo apt-get install -y ripgrepAmazon Linux 2023 note:
- If
dnf install ripgrepreturns “No match for argument”, install via Rust toolchain:
sudo dnf install -y cargo
cargo install ripgrep
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcyumanddnfare equivalent on Amazon Linux 2023, so switching from one to the other usually does not change package availability.
- Clone this repository.
- Run:
./scripts/install/install-macos.sh- Open a new terminal and run:
search a-string- Clone this repository.
- Run:
./scripts/install/install-linux.sh- Open a new terminal and run:
search a-string- Clone this repository.
- Run in PowerShell:
./scripts/install/install-windows.ps1- If script execution is blocked, run once (current user):
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned- Run right away in the same PowerShell session:
search a-string- If
searchis still not found in the same session, load your profile once:
. $PROFILE
search a-string- For future sessions, open a new PowerShell window and run:
search a-stringTroubleshooting:
Get-Command search -All
Test-Path $PROFILEIf your shell is started with -NoProfile, profile-based functions (including search) will not load automatically.
macOS:
./scripts/uninstall/uninstall-macos.shLinux:
./scripts/uninstall/uninstall-linux.shWindows (PowerShell):
./scripts/uninstall/uninstall-windows.ps1Uninstall scripts remove installed files from your user home and clean the alias/profile line added during install.
search
search [OPTIONS] STRING
search [OPTIONS] PROFILE STRINGRunning search with no arguments prints the help with all options.
Profiles:
grepx(default)codescanandroidcodewebjavajava_filenamejavascriptxhtmlcsssqlxmldocsfilenamex_filenamejar
Examples:
search a-string
search --profile-list
search --version
search --format txt fox
search --deep a-string
search --max-per-file 50 a-string
search --format txt --context 0 --max-per-file 2 --max-scan-lines 500 --max-render-lines 200 fox
search xml another-string
search filename part-of-file-nameOptions:
--version: print version and exit--profile-list: print available profiles and exit--format html|txt: choose output format (defaulthtml)--open: open the generated report after search--deepor--hidden: include hidden files/directories (slower)--context N: context lines before/after each hit (default3)--max-per-file N: limit matches per file (default200,0disables limit)--max-filesize SIZE: skip files larger thanSIZE(default1M, usenoneto disable)--max-scan-lines N: cap lines collected fromrgbefore rendering (default20000,0disables cap)--max-line-length N: trim very long result lines before rendering (default2000,0disables trimming)--max-render-lines N: cap rendered report lines (default12000,0disables cap)
Each run creates a report file in ~/search-results:
- default:
.html - with
--format txt:.txt
Optional override:
- Set
SEARCH_RESULTS_DIRto write results to a custom directory. - Set
SEARCH_CONFIG_FILEto point to a custom profile/default config file.
Shared config:
- Profiles and default limits are centralized in
config/search-profiles.conf. - Both
scripts/runtime/search.shandscripts/runtime/search.ps1read this file to avoid config drift.
- The generated HTML is plain and portable (no browser plugins required).
- File naming is sanitized for cross-platform compatibility.
- You can still run scripts directly from the repo:
macOS/Linux shell:
./scripts/runtime/search.sh STRING
./scripts/runtime/search.sh PROFILE STRINGWindows PowerShell:
./scripts/runtime/search.ps1 STRING
./scripts/runtime/search.ps1 PROFILE STRINGmacOS / bash:
bash ./scripts/tests/smoke.tests.mac.shLinux / bash:
bash ./scripts/tests/smoke.tests.linux.shWindows PowerShell:
Invoke-Pester ./scripts/tests/smoke.tests.windows.ps1Make targets:
make
make help
make test-mac
make test-linux
make test-ps
make test
make run ARGS="fox"
make uninstall-mac
make uninstall-linux
make uninstall-windowsmake/make help: list available targetsmake run ARGS="...": runsearch.shwith custom arguments
Windows note:
- The
makecommands above requiremaketo be installed. - Run the install commands from PowerShell.
- Option 1 (Scoop, recommended):
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex
scoop install make- Option 2 (winget standalone make):
winget install GnuWin32.Make- Option 3 (Git Bash, which also includes
makein many setups):
winget install Git.Git- After installing, close and reopen PowerShell before running
make.
- GitHub Actions runs smoke tests on every push and pull request:
- Linux:
make test-linux - macOS:
make test-mac - Windows:
Invoke-Pester ./scripts/tests/smoke.tests.windows.ps1
- Linux:
- Software Developer: Rod Oliveira
- GitHub: https://github.com/jrodolfo
- Webpage: https://jrodolfo.net
- MIT License
- Copyright (c) 2026 Rod Oliveira
- See LICENSE


