[Hampshire] grep -50 foo /dev/sda1 runs out of memory

Top Page

Reply to this message
Author: Victor Churchill
Date:  
To: Hampshire LUG Discussion List
Subject: [Hampshire] grep -50 foo /dev/sda1 runs out of memory
Hi,

I have a firm recollection of reading war stories in the past about
how the above incantation will find textual information on the disk
that you have mislaid (the information, that is, not the disk).

So I had exited an editor session attached to my GMail through the
"It's All Text!" Firefox extension, which lets you fill in textareas
in an external editor. Except in this case it didn't - I typed stuff
in for about 20 minutes, saved, exited and the work was /not/ in my
mail window. Bother, said Pooh.

So I recalled this grep trick.Unfortunately it chugs for a while then
exits with an error:

victor@pan2:~$ sudo grep -100 Vishal /dev/sda1
grep: /dev/sda1: Cannot allocate memory

I /thought/ grep would work through a file of any size... is ther
anything I can do about this?

thanks,

victor


--
best regards,

Victor Churchill,
Bournemouth