Skip to Content
gnux

-w, --word-regexp

Match only whole words.

An option of grepx.

Usage

grepx -w PATTERNS [FILE]...
grepx --word-regexp PATTERNS [FILE]...

Details

ShortLongValueDefaultMeaning
-w--word-regexpnonematch only whole words

Examples

Search a source tree for a whole word, with file names and line numbers

grepx -rnw 'TODO' src
Output
src/main.go:42:    // TODO: handle the empty case

Help in the terminal

gnux help grepx --word-regexp

On this page