Skip to Content
gnux

-r, --recursive

Like --directories=recurse.

An option of grepx.

Usage

grepx -r PATTERNS [FILE]...
grepx --recursive PATTERNS [FILE]...

Details

ShortLongValueDefaultMeaning
-r--recursivenonelike --directories=recurse

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

List the files under the current directory that contain a string

grepx -rl 'deprecated' .

List the Go files that lack a license header

grepx -rL --include='*.go' 'SPDX-License-Identifier' .

Search a tree but skip the dependency and VCS directories

grepx -rn --exclude-dir=node_modules --exclude-dir=.git 'fetch(' .

Help in the terminal

gnux help grepx --recursive

On this page