LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

ug

ugrep with config file, pretty output, and sorted results

TLDR

Search for a pattern in a file
$ ug "[pattern]" [file]
copy
Search recursively in current directory
$ ug -r "[pattern]"
copy
Case-insensitive search
$ ug -i "[pattern]" [file]
copy
Show line numbers
$ ug -n "[pattern]" [file]
copy
Interactive TUI query mode
$ ug -Q
copy
Count matches per file
$ ug -c "[pattern]" [file]
copy
List only filenames with matches
$ ug -l "[pattern]"
copy
Search for whole words only
$ ug -w "[pattern]" [file]
copy

SYNOPSIS

ug [options] [pattern] [file...]

DESCRIPTION

ug is the user-friendly front-end to ugrep. It is equivalent to running `ugrep --config --pretty --sort`: it automatically loads the `.ugrep` configuration file from the working directory or home directory, enables pretty-printed colour output, and sorts results by filename. These defaults make ug suitable for interactive terminal use.Unlike plain ugrep (which targets scripting and batch use with no sorting for performance), ug is tuned for exploratory searching. It supports all ugrep options including Boolean queries, fuzzy matching, hexdumps, and searching inside archives and compressed files.The interactive TUI mode (`-Q`) lets you type a query and see results update in real time.

PARAMETERS

-i

Case insensitive matching.
-r, -R
Recursive search (-R follows symlinks).
-n
Show line numbers.
-Q
Launch interactive TUI query mode.
-c
Count matching lines per file.
-l
Print only names of files with matches.
-w
Match whole words only.
-e pattern
Specify a pattern (use multiple times for alternation).
--no-config
Do not load the .ugrep configuration file.

SEE ALSO

ugrep(1), grep(1), rg(1)

Copied to clipboard
Kai