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

Startseite

Nachricht beantworten
Autor: Bob Dunlop
Datum:  
To: hampshire
Betreff: Re: [Hampshire] grep -50 foo /dev/sda1 runs out of memory
On Thu, Feb 10 at 10:22, Victor Churchill wrote:
...
> I believe 'grep -number' will give <number> lines of context around
> the match. Like 'grep -A 100 -B 100".


grep -number is not portable -A -B is. Unless you are putting it in a script
whatever works for you is fine.

Anyway rather than the tr above you might want to try out strings.

strings /dev/sda1 | grep -100 Vishal

Strings is a filter specifically designed to find printable strings in a file
so presumably designed to cope with lots of binary mush.

Let's hope your tempfiles weren't stored on ramdisk.
-- 
        Bob Dunlop