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

Top Page

Reply to this message
Author: Daniel Llewellyn
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] grep -50 foo /dev/sda1 runs out of memory
On Thu, Feb 10, 2011 at 20:19, Hugo Mills <hugo@???> wrote:
>   Also, note that you're only going to get one line of the output
> with little or no indication of where in the disk it is, so you
> _still_ won't have the data -- just one line of it and no idea of
> where the rest is, so the above incantation probably isn't what you
> need. (I'm too tired right now to think of what it is that you _do_
> need, though; sorry. Maybe someone else can help with that).


a VERY long-whinded and brute-force way would be to pass every file on
the system through grep, something like:

find / -type f -exec grep Vishal '{}' \;

However, this again will just give one line of output for each match
instead of the whole file, and won't tell you which file contained the
match. I too can't think right now.