grep

to revert the search use -v:

grep -v 'pattern' file

extract config lines omitting remarks (#) and empty lines:

grep -v '^#' file.conf | grep -v '^$'

print also the filename where pattern matches:

grep -H 'pattern' *

watch disk usage while you're copying data to your usb drive:

watch -n 3 'df -hlm | egrep "Datei|usb"'

output:

Every 3,0s: df -hlm | egrep "Datei|usb"                  Tue May  5 12:00:45 2009

Dateisystem          1M-Blcke   Benutzt Verfgbar Ben% Eingehngt auf
/dev/sda1               715275    394998    320278  56% /media/usbdisk
linux/grep.txt · Last modified: 2009/05/05 12:09 by tb
CC Attribution-Noncommercial-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0