need SIMPLE grep piping examples

Mihai Maties mihai at xcyb.org
Fri Mar 26 14:08:00 UTC 2004


On Friday 26 March 2004 15:04, Thiers Botelho wrote:
> All I need to do right now is something like:
>
> df -m | grep [ 'ilesystem' , '/dev/foobar' ]
>
> (I need to show any line containing _either_ of the strings)
>
> so that a script could output just the header line of 'df' plus the single
> line describing '/dev/foobar' below it.

df -m|grep -E 'Filesystem|/dev/foobar'
or
df -m|egrep 'Filesystem|/dev/foobar'


Mihai





More information about the users mailing list