grep - print only matched
2016-03-16 ::
( 1 minutes reading )
you can use the -o
flag to only print matched value. Example
$ echo "Hello fellow unix fan" | grep --color -o nix
nix
$ echo "Hello fellow unix fan" | grep --color -o nux
$ echo $?
1
comments powered by Disqus