Skip to Content
gnux

-o, --only-matching

Print only the matched (non-empty) parts of lines, one to a line.

An option of grepx.

Usage

grepx -o PATTERNS [FILE]...
grepx --only-matching PATTERNS [FILE]...

Details

ShortLongValueDefaultMeaning
-o--only-matchingnoneprint only the matched (non-empty) parts of lines, one to a line

Examples

grepx -oE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' access.log

Help in the terminal

gnux help grepx --only-matching

On this page