Is possible for grep, or egrep to see the exact word? See this example: those are my groups
groups
floppy audio video cdrom games plugdev power netdev scanner users
I want to see only power, but return the entire line
groups |grep --color -w power
floppy audio video cdrom games plugdev power netdev scanner users
Is easy to return only power using pipe with awk or cut
groups |grep --color -w power|cut -d ' ' -f 9
power
but my question is: is possible for grep or egrep command to return the exact word only?
egrep
is deprecated in favor ofgrep -E
. Similarlyfgrep
is deprecated in favor ofgrep -F
.