grep
From NetBSD Wiki
The grep(1) utility can be used to print lines matching a pattern.
Examples
Search for text in files:
$ grep smbd /etc/*.conf /etc/rc.conf:smbd=YES
Check the number of logged lines from a daemon:
$ grep -c upsd /var/log/messages 42
Check the status of your network interfaces (this could be an handy alias):
$ ifconfig -au | grep -E 'media|status'
media: Ethernet autoselect (100baseTX full-duplex)
status: active
media: Ethernet autoselect (100baseTX full-duplex)
status: active
