• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

What not to do with grep

kamper

Diamond Member
grep -r somepattern * > grepresults.txt

I couldn't figure out why my computer was bogging down so badly. By the time I did figure it out I had a 22 gig text file 😕
 
Along those lines ... I discovered today that MySQL does not like receiving a 3MB query via the C API. Couldn't figure out why the connection always dropped, until I actually looked at the size of the insert query that it was trying to push through 😛
 
I did it at the root of my dev directory (this is windows, dev means development, not device). Not that it matters where you do it, if the pattern matches anything you're screwed.
 
Originally posted by: kamper
I did it at the root of my dev directory (this is windows, dev means development, not device). Not that it matters where you do it, if the pattern matches anything you're screwed.

Actually, only if it matches something before it scans the file you're directing the output into.
 
Originally posted by: n0cmonkey
I'm guessing you did that in /? I do stuff like that all the time, just not in /.
If I had done it in / would it eventually hit /dev/random or something like that and just spin forever? That would probably be hard on processor time but not on the disk. In my example there was almost no activity at all going on (according to the Task Manager) which is why I was so confused as to what was happening 😛
 
Originally posted by: kamper
Originally posted by: n0cmonkey
I'm guessing you did that in /? I do stuff like that all the time, just not in /.
If I had done it in / would it eventually hit /dev/random or something like that and just spin forever? That would probably be hard on processor time but not on the disk. In my example there was almost no activity at all going on (according to the Task Manager) which is why I was so confused as to what was happening 😛

Not sure. I guess I can try it when I get home. I've never tried it in / or /dev. I typically only do things like that in /etc or ~/. 😛
 
Originally posted by: BingBongWongFooey
Yeah it would get stuck on /dev/{{u,}random,zero} (probably others for various reasons too)

Never thought of that, hehe, ran out of memory after a second or two when greping for blah in /dev/zero

Hey look, I have 400 MB of free RAM! 😀

Wonder if I can sell a script that does that as a "Memory optimizer" 😉
 
Back
Top