まずはand検索。多段grepプロセスでパイプ処理。
$ grep -e 'title' /boot/grub/menu.lst | grep -e 'Debian' title Debian GNU/Linux, kernel 2.6.26-2-686 title Debian GNU/Linux, kernel 2.6.26-2-686 (single-user mode) title Debian GNU/Linux, kernel 2.6.26-1-686 title Debian GNU/Linux, kernel 2.6.26-1-686 (single-user mode)
次に or 検索。単一grepプロセスで多重 -e オプション。
$ grep -e 'Debian' -e 'title' /boot/grub/menu.lst # title Windows 95/98/NT/2000 # title Linux title Debian GNU/Linux, kernel 2.6.26-2-686 title Debian GNU/Linux, kernel 2.6.26-2-686 (single-user mode) title Debian GNU/Linux, kernel 2.6.26-1-686 title Debian GNU/Linux, kernel 2.6.26-1-686 (single-user mode)