Ugrep
🔍 ugrep 7.8 file pattern searcher -- a user-friendly, faster, more capable grep replacement. Includes a TUI, Google-like Boolean search with AND/OR/NOT, fuzzy search, hexdumps, searches (nested) archives (zip, 7z, tar, pax, cpio), compressed files (gz, Z, bz2, lzma, xz, lz4, zstd, brotli), pdfs, docs, and more
Install / Use
npx skills add Genivia/ugrepInstalls into whichever agent you are using.
README
Why use ugrep?
-
ugrep is compatible to GNU/BSD grep, but much faster and with a ton of new features
-
ugrep is a drop-in replacement for BSD and GNU grep (copy or symlink
ugtogrep, and toegrepand tofgrep), unlike other popular grep claiming to be "grep alternatives" or "replacements" when those actually implement incompatible command-line options and use an incompatible regex matcher, i.e. Perl regex only versus POSIX BRE (grep) and ERE (egrep) when ugrep supports all regex modes -
ugrep is typically faster than rg, ag, and GNU grep
-
full Unicode extended regex pattern syntax with multi-line pattern matching without any special command-line options
-
includes an interactive TUI with built-in help, Google-like search with AND/OR/NOT patterns, fuzzy search, search (nested) zip/7z/tar/pax/cpio archives, tarballs and compressed files gz/Z/bz/bz2/lzma/xz/lz4/zstd/brotli, search and hexdump binary files, search documents such as PDF, doc, docx, and output in JSON, XML, CSV or your own customized format
-
includes a file indexer to speed up searching slow and cold file systems
Development roadmap
-
quality assurance by testing and validation to make sure ugrep is reliable
-
make ugrep run even faster with future updates and post reproducible performance results
-
consider new features requested by users when useful to support a broad use case
Overview
Commands
-
ugis for interactive use, which loads an optional .ugrep configuration file with your preferences located in the working directory or home directory,ug+also searches pdfs, documents, e-books, image metadata -
ugrepfor batch use like GNU grep without a .ugrep configuration file,ugrep+also searches pdfs, documents, e-books, image metadata
What does ugrep add that GNU grep does not support?
-
Matches Unicode patterns by default and automatically searches UTF-8, UTF-16 and UTF-32 encoded files
-
Matches multiple lines with
\nor\Rin regex patterns, no special options are required to do so! -
Built-in help:
ug --help, whereug --help WHATdisplays options related toWHATyou are looking for💡
ug --help regex,ug --help globs,ug --help fuzzy,ug --help format. -
User-friendly with customizable configuration files used by the
ugcommand intended for interactive use that loads a .ugrep configuration file with your preferencesug PATTERN ... ugrep --config PATTERN ...💡
ug --save-config ...options-you-want-to-save...saves a .ugrep config file in the working directory so that the next time you runugthere it uses these options. Do this in your home directory to save a .ugrep config file with options you generally want to use. -
Interactive query TUI, press F1 or CTRL-Z for help and TAB/SHIFT-TAB to navigate to dirs and files
ug -Q ug -Q -e PATTERN💡
-QreplacesPATTERNon the command line to let you enter patterns interactively in the TUI. In the TUI use ALT+letter keys to toggle short "letter options" on/off, for example ALT-n (option-n) to show/hide line numbers. -
Search the contents of archives (zip, tar, pax, jar, cpio, 7z) and compressed files (gz, Z, bz, bz2, lzma, xz, lz4, zstd, brotli)
ug -z PATTERN ... ug -z --zmax=2 PATTERN ...💡 specify
-z --zmax=2to search compressed files and archives nested within archives. The--zmaxargument may range from 1 (default) to 99 for up to 99 decompression and de-archiving steps to search nested archives -
Search with Google-like Boolean query patterns using
-%patterns withAND(or just space),OR(or a bar|),NOT(or a dash-), using quotes to match exactly, and grouping with( )(shown on the left side below); or with options-e(as an "or"),--and,--andnot, and--notregex patterns (shown on the right side below):ug -% 'A B C' ... ug -e 'A' --and 'B' --and 'C' ... ug -% 'A|B C' ... ug -e 'A' -e 'B' --and 'C' ... ug -% 'A -B -C' ... ug -e 'A' --andnot 'B' --andnot 'C' ... ug -% 'A -(B|C)'... ug -e 'A' --andnot 'B' --andnot 'C' ... ug -% '"abc" "def"' ... ug -e '\Qabc\E' --and '\Qdef\E' ...where
A,BandCare arbitrary regex patterns (use option-Fto search strings)💡 specify option
-%%(--bool --files) to apply the Boolean query to files as a whole: a file matches if all Boolean conditions are satisfied by matching patterns file-wide. Otherwise, Boolean conditions apply to single lines by default, since grep utilities are generally line-based pattern matchers. Option--statsdisplays the query in human-readable form after the search completes. -
Search pdf, doc, docx, e-book, and more with
ug+using filters associated with filename extensions:ug+ PATTERN ...or specify
--filterwith a file type to use a filter utility:ug --filter='pdf:pdftotext % -' PATTERN ... ug --filter='doc:antiword %' PATTERN ... ug --filter='odt,docx,epub,rtf:pandoc --wrap=preserve -t plain % -o -' PATTERN ... ug --filter='odt,doc,docx,rtf,xls,xlsx,ppt,pptx:soffice --headless --cat %' PATTERN ... ug --filter='pem:openssl x509 -text,cer,crt,der:openssl x509 -text -inform der' PATTERN ... ug --filter='latin1:iconv -f LATIN1 -t UTF-8' PATTERN ...💡 the
ug+command is the same as theugcommand, but also uses filters to search PDFs, documents, and image metadata -
Display horizontal context with option
-o(--only-matching) and context options-ABC, e.g. to find matches in very long lines, such as Javascript and JSON sources:ug -o -C20 -nk PATTERN longlines.js💡
-o -C20fits all matches with context in 20 characters before and 20 charactess after a match (i.e. 40 Unicode characters total),-nkoutputs line and column numbers. -
Find approximate pattern matches with fuzzy search, within the specified Levenshtein distance
ug -Z PATTERN ... ug -Z3 PATTTERN ...💡
-Znmatches up tonextra, missing or replaced characters,-Z+nmatches up tonextra characters,-Z-nmatches with up tonmissing characters and-Z~nmatches up tonreplaced characters.-Zdefaults to-Z1. -
Fzf-like search with regex (or fixed strings with
-F), fuzzy matching with up to 4 extra characters with-Z+4and words only with-w, using-%%for file-wide Boolean searchesug -Q -%% -l -w -Z+4 --sort=best💡
-llists the matching files in the TUI, pressTABthenALT-yto view a file,SHIFT-TABandAlt-lto go back to view the list of matching files ordered by best match -
Search binary files and display hexdumps with binary pattern matches (Unicode text or
-Ufor byte patterns)ug --hexdump -U BYTEPATTERN ... ug --hexdump TEXTPATTERN ... ug -X -U BYTEPATTERN ... ug -X TEXTPATTERN ... ug -W -U BYTEPATTERN ... ug -W TEXTPATTERN ...💡
--hexdump=4chC1displays4columns of hex without a character columnc, no hex spacingh, and with one extra hex lineC1before and after a match. -
Include files to search by file types or file "magic bytes" or exclude them with
^ug -t TYPE PATTERN ... ug -t ^TYPE PATTERN ... ug -M 'MAGIC' PATTERN ... ug -M '^MAGIC' PATTERN ... -
Include files and directories to search that match gitignore-style globs or exclude them with
^ug -g 'FILEGLOB' PATTERN ... ug -g '^FILEGLOB' PATTERN ... ug -g 'DIRGLOB/' PATTERN ... ug -g '^DIRGLOB/' PATTERN ... ug -g 'PATH/FILEGLOB' PATTERN ... ug -g '^PATH/FILEGLOB' PATTERN ... ug -g 'PATH/DIRGLOB/' PATTERN ... ug -g '^PATH/DIRGLOB/' PATTERN ... -
Include files to search by filename extensions (suffix) or exclude them with
^, a shorthand for-g"*.EXT"ug -O EXT PATTERN ... ug -O ^EXT PATTERN ... -
Include hidden files (dotfiles) and directories to search (omitted by default)
ug -. PATTERN ... ug -g'.*,.*/' PATTERN ...💡 specify
hiddenin your .ugrep to always search hidden files withug. -
Exclude files specified by .gitignore etc.
ug --ignore-files PATTERN ... ug --ignore-files=.ignore PATTERN ...💡 specify
ignore-filesin your .ugrep to always ignore them withug. Add additionalignore-files=...as desired. -
Search patterns excluding negative patterns ("match this but not that")
ug -e PATTERN -N NOTPATTERN ... ug -e '[0-9]+' -N 123 ... -
Use predefined regex patterns to search source code, javascript, XML, JSON, HTML, PHP, markdo
Related Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
blender-python-addon
40.5kBlender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting
flutter-development-guidelines-cursorrules-prompt-file
40.5kCursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines.
commit-push-pr
140.6kCommit, push, and open a PR
